Connecting two points with a 3D sketch

Connecting two points with a 3D sketch

t_gawlik
Contributor Contributor
625 Views
2 Replies
Message 1 of 3

Connecting two points with a 3D sketch

t_gawlik
Contributor
Contributor

Hello, 
I am an iLogic beginner. I would like to use iLogic rule to connect two specific points (A1 and B1) by 3d sketch. My guess is that the rule must first create this sketch "Sketch 1" in the browser history and then connect these points with a line.

I don't know how to go about this, can you help?

0 Likes
Accepted solutions (1)
626 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

try this rule. You can run it and select 2 work points. 

Dim doc As PartDocument = ThisDoc.Document
Dim def As PartComponentDefinition = doc.ComponentDefinition

Dim wpA1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPointFilter, "Select work point A1")
Dim wpB1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPointFilter, "Select work point B1")

Dim sketch3D As Sketch3D = def.Sketches3D.Add()
sketch3D.SketchLines3D.AddByTwoPoints(wpA1, wpB1)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

t_gawlik
Contributor
Contributor

Thanks  JelteDeJong 

Very close to the final result
There will be more points in the future (A1 B1, A2 B2 ... An Bn) and they will be generated as a list (array?) or something similar. I don't want to point them manually but want the 3D sketch to connect them automatically

 

 

0 Likes