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: 

Drawing dimension on-off when unsuppressed-suppressed part

5 REPLIES 5
Reply
Message 1 of 6
eatrejo
414 Views, 5 Replies

Drawing dimension on-off when unsuppressed-suppressed part

Hello,

I'd like to create a drawing of an assembly that deletes a dimension of a part if the part has been suppressed and adds dim back when part is unsuppressed.

 

Any piece of code that will do the trick?

 

Thanks,

 

Alberto.

Tags (1)
5 REPLIES 5
Message 2 of 6
Vladimir.Ananyev
in reply to: eatrejo

Just an idea.

You may develop code that moves all orphaned dimensions to some special layer that could hide them.

For Each dimension In dimensions

     If dimension.Attached = False then

           Dimension.Layer = HiddenLayerObject

      End If

Next

 

And vice versa non- orphaned dimensions could be moved from the hidden to visible layer. 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 6
eatrejo
in reply to: Vladimir.Ananyev

Thanks Vladimir. Will try and get back to you.
Message 4 of 6
eatrejo
in reply to: Vladimir.Ananyev

Hi Vladimir,

 

I tried the code but it doesn't seem to be working. I cannot change the layer in the drawing through a rule.

 

Also, when the part is supressed in the assembly the dimension gets deleted, making it impossible to change the dimension layer. (Orphaned dimension don't exist because they get deleted as soon as they become orphaned)

 

Attached is a simplified assembly. I'd like to suppress and unsupress "Rod_1" in the assembly and do the same with its respective dimension on the drawing.

 

Thanks,

 

Alberto.

Message 5 of 6
Vladimir.Ananyev
in reply to: eatrejo

Hi Alberto, 

It looks like method described in http://adndevblog.typepad.com/manufacturing/2013/08/hide-drawing-dimensions-which-are-orphaned.html  works for parts but does not work for assemblies.

Component suppression in the assembly deletes all the associated dimensions in the drawing view.  They do not exist in the DrawingDimensions collection any more and thus cannot be easily restored.   Smiley Sad

You have to recreate disappeared dimensions.  The implementation of this procedure essentially depends on your intent and model complexity.   You may either retrieve desired dimensions or you should be able to find GeometryIntent objects required for new dimension.  IMHO Inventor.Attribute object could be useful for this purpose.

This post is a good start point to learn drawing automation:  http://modthemachine.typepad.com/my_weblog/2009/10/drawing-automation.html

Webcast archive:  http://adndevblog.typepad.com/manufacturing/2013/05/api-webcast-archive.html

Cheers,

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 6 of 6
_KarlH
in reply to: eatrejo

I was hoping that Inventor Developers would have finally addressed this short-coming with the new Model State behaviour found in Inventor 2022 and Inventor 2023. But unfortunately, after testing with the latest patched Inventor 2023, it's still not possible to recover a dimension that's tied to a drawing view of a suppressed part within an assembly. Any dimension that's half consumed becomes orphaned (such as a linear dim between a suppressed and unsuppressed component),  and any loose dimension (that's strictly tied to a suppressed component) is simply deleted and doesn't return upon the component returning to an unsuppressed state by toggling the the Model State.

This is extremely frustrating. 😟 For a dynamic model where the model state switches back-and-forth, traditional dimensions on any dynamically suppressing parts within any drawings will eventually delete or orphan themselves.

 

So... what's the solution?

There may be workarounds, but most are labour intensive and ugly to work with. I think I might hit up the idea station... assuming this hasn't already been requested.

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

Post to forums  

Autodesk Design & Make Report