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: 

Zoom Highlightset

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
488 Views, 5 Replies

Zoom Highlightset

Hi there,

 

I highlighted some drawingcurves in a drawing by the API and now I would like to "zoom fit" the highlighted set for a better visual effect. Does anyone known a solution?

 

greetings Joris

 

AI 2010, Win 7 64bit

Tags (1)
5 REPLIES 5
Message 2 of 6
jdkriek
in reply to: Anonymous

This should work as long as the highlighted set counts as a selection or can be added to the selection set at least.

 

I formatted it for iLogic, but it's easy to tweak for VBA if needed.

 

Dim oDoc As AssemblyDocument: oDoc = ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition: oDef = oDoc.ComponentDefinition
Dim oOccs As ComponentOccurrences: oOccs = oDef.Occurrences
   
Dim oOcc As ComponentOccurrence: oOcc = oOccs.Item(oOccs.Count)
   
Dim oSSet As SelectSet: oSSet = oDoc.SelectSet
Call oSSet.Select(oOcc)
   
Dim oControlDef As ControlDefinition: oControlDef = ThisApplication _
.CommandManager.ControlDefinitions _
.Item("AppZoomSelectCmd")
oControlDef.Execute
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 3 of 6
Anonymous
in reply to: jdkriek

Unfortunately, I think 'Zoom Selected' only works in the assembly environment and not in the drawing environment.

And when I execute a Control Definition I loose my highlighted set.

 

greetings Joris

Message 4 of 6
jdkriek
in reply to: Anonymous

Doh, it was late and I missed the part where this was a drawing. I'll tweak it tonight. Got to stop writing code so late 😉
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 5 of 6
ajcampbell
in reply to: jdkriek

Was there a solution to this? I'm looking to do something similar from a .Net addin.

Message 6 of 6
ajcampbell
in reply to: ajcampbell

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

Post to forums  

Autodesk Design & Make Report