Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Window select project geometry

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mat_hijs
439 Views, 2 Replies

Window select project geometry

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.

2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: mat_hijs

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

Message 3 of 3
mat_hijs
in reply to: JelteDeJong

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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report