Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

Checking assembly components fromout drawing ilogic rule

2 REPLIES 2
Reply
Message 1 of 3
Daan_M
507 Views, 2 Replies

Checking assembly components fromout drawing ilogic rule

Hi,

 

So i ran into the following; My dwg iLogic places dimensions on my drawing using workpoints.

Sometimes i supress a part in my assembly, in that case i do not want a dimension to be placed to that part, since theres nothing there, E.g.

Daan_M_0-1597393898231.png

Daan_M_1-1597393947702.png

 

to make sure only the active component dimensions are places i tried the following, but without succes;

 

- I wanted to use a if statement checking if the component occurence is active in my assembly, but that doesn't seem possible in drawing document iLogic

 

- I wanted to supress the workpoint in my assembly iLogic so no dimension would be placed in the dwg, but there is no supression option as far as i see

 

Any good solution?

 

 

 

 

2 REPLIES 2
Message 2 of 3
WCrihfield
in reply to: Daan_M

Perhaps the WorkPoints can be created within the part files or sub-assembly files, then if the WorkPoints are named a certain way, they will get copied into the assembly as WorkPointProxy.  Then maybe if you suppress the part, it will also suppress the source of the WorkPointProxy, which will suppress the WorkPointProxy too.

 

Or, if you remember to turn the visibility of the assembly work point off when you turn the visibility of the part off (or suppress it), then when you go to transfer workpoints to the drawing, check to see if they are visible in the model, before transferring them.

 

The third, and probably most promising, but also somewhat complex option, is to name the faces/edges/vertexes within the part models, then retrieve those entities within your code to identify the geometry you want to attach your dimensions to.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3
JelteDeJong
in reply to: Daan_M

im not sure what you did try. But i think it possible to check if a occurrence is suppressed. have a look at the following code.

Dim dDOc As DrawingDocument = ThisDoc.Document

Dim sheet As Sheet = dDOc.Sheets.Item("Sheet:1")
Dim view As DrawingView = sheet.DrawingViews.Item(1)
Dim assemblyDocument As AssemblyDocument = view.ReferencedDocumentDescriptor.ReferencedDocument

For Each occ As ComponentOccurrence In assemblyDocument.ComponentDefinition.Occurrences
    If ((occ.Name.Equals("??????")) And (occ.Suppressed = True)) Then
        ' Dont make the dimensions in the drawing......
    End If
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

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

Post to forums  

Autodesk Design & Make Report