Window select project geometry

Window select project geometry

mat_hijs
Collaborator Collaborator
727 Views
3 Replies
Message 1 of 4

Window select project geometry

mat_hijs
Collaborator
Collaborator

Does anyone happen to have some code that allows me to project geometry using window selection? I want to project a lot of lines from one sketch to another which is quite tedious when I have to click each line separately. Especially because these lines are all on top of construction lines that I don't want to project. But this means I have to use select other half of the time.

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

JelteDeJong
Mentor
Mentor
Accepted solution

you can try this. Run this rule. Select the original sketch in your browser then select the target sketch in your browser. An watch the magic...

Dim doc As PartDocument = ThisDoc.Document

Dim orgSketch As PlanarSketch = ThisApplication.CommandManager.
	Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select original sketch")
Dim newSketch As PlanarSketch = ThisApplication.CommandManager.
	Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select new sketch")

For Each ent As SketchEntity In orgSketch.SketchEntities
    If ent.Construction Then Continue For
    If ent.Type = ObjectTypeEnum.kSketchPointObject Then Continue For
    newSketch.AddByProjectingEntity(ent)
Next

 

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

0 Likes
Message 3 of 4

mat_hijs
Collaborator
Collaborator

I don't need to project every line that is not a construction line, but this seems to work and deleting projected lines that I don't need is a lot faster than projecting them one by one since this can be done with window selection.

Thank you very much!

0 Likes
Message 4 of 4

Yijiang.Cai
Autodesk
Autodesk

It has been implemented in 2023.2, and you could more information in the page. Thanks!

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
0 Likes