iLogic - create Workplane and Workpoint

iLogic - create Workplane and Workpoint

Anonymous
Not applicable
3,368 Views
3 Replies
Message 1 of 4

iLogic - create Workplane and Workpoint

Anonymous
Not applicable

Hello,

 

I need to create iLogic rule to create new Workplane with specific name, offset by 0 mm from selected face or from origin plane and then create Workpoint on intersection of 3 selected planes/faces, also with specific name.

 

I need to use it for some measurements from center of gravity.

 

Thank you.

0 Likes
Accepted solutions (1)
3,369 Views
3 Replies
Replies (3)
Message 2 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, With this rule you can create a work point by selecting 3 planes or three flat faces.

 

oDef = ThisDoc.Document.ComponentDefinition

Dim face1 As Object 
face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")
Dim face2 As Object 
face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")
Dim face3 As Object 
face3 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")


Dim oWPoint As WorkPoint
oWPoint = oDef.WorkPoints.AddByThreePlanes(face1 , face2 , face3) 
oWPoint.Name = "My_New_Work_Point"

 

With this rule you can create a work plane parallel to another plane or face at a certain distance.

 

oDef = ThisDoc.Document.ComponentDefinition
Distance= 2' Units in mm
Dim face As Object 
face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")

Dim oWPlane As WorkPlane
oWPlane = oDef.WorkPlanes.AddByPlaneAndOffset(face, Distance/10) 
oWPlane.Name = "New_Work_Plane"

 If this answer has served you please mark it as an accepted solution. Thank you . regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 4

Togo
Participant
Participant

@Sergio.D.Suárez wrote:

Hi, With this rule you can create a work point by selecting 3 planes or three flat faces.

 

oDef = ThisDoc.Document.ComponentDefinition

Dim face1 As Object 
face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")
Dim face2 As Object 
face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")
Dim face3 As Object 
face3 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")


Dim oWPoint As WorkPoint
oWPoint = oDef.WorkPoints.AddByThreePlanes(face1 , face2 , face3) 
oWPoint.Name = "My_New_Work_Point"

 

With this rule you can create a work plane parallel to another plane or face at a certain distance.

 

oDef = ThisDoc.Document.ComponentDefinition
Distance= 2' Units in mm
Dim face As Object 
face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select Face")

Dim oWPlane As WorkPlane
oWPlane = oDef.WorkPlanes.AddByPlaneAndOffset(face, Distance/10) 
oWPlane.Name = "New_Work_Plane"

 If this answer has served you please mark it as an accepted solution. Thank you . regards


 

Hi, thank you for your answer.

Your rules are working in Part, but not in my Assesembly. I need to use it in Assembly.

Message 4 of 4

Anonymous
Not applicable

Hi, thank you, me too, i don't create in asssembly, help me 😅

'GET FOR ASSEMBLY
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition

oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartVertexFilter, "CHỌN POINT_1")
'Dim POINT_1 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
Dim POINT_1 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
POINT_1.Name = "POINT_1"

 

 

0 Likes