iLogic to retrieve model annotations

clutsa
Collaborator

iLogic to retrieve model annotations

clutsa
Collaborator
Collaborator

This is kind of a two part question and there is a lot of code so I'm hoping to abbreviate as much as possible. I have iLogic code that retrieves two dimensions from my model on a view named "FRONT". 

Dim FrontName = "FRONT"
Dim FrontView As DrawingView = ActiveSheet.View(FrontName).View
Dim myDimColl As ObjectCollection = tObj.CreateObjectCollection
Dim BasePinHoleAssy As ComponentOccurrence
Dim BasePinHoleCompOcc As ComponentOccurrence
Dim BasePinHoleCompOccProxy As ComponentOccurrenceProxy
...
'Code that sets other variables not listed
...
BasePinHoleAssy = docM.ComponentDefinition.Occurrences.ItemByName(BaseEndfittingAssyStandard)
BasePinHoleCompOcc = BasePinHoleAssy.Definition.Occurrences.ItemByName(BaseEndfittingCompStandard)
Call BasePinHoleAssy.CreateGeometryProxy(BasePinHoleCompOcc,BasePinHoleCompOccProxy)
...
'Other proxy object code
Dim ProxyList As New ArrayList
'Code to populate ProxyList 
...
For Each ProxyObj In ProxyList
Dim RetrievableDims As ObjectCollection = ActiveSheet.Sheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(FrontView, ProxyObj)
...
'Code that gets the dimensions I want from RetrievableDims 
...
Logger.Debug("myDimColl.Count = {0}",{myDimColl.Count})
	If myDimColl.Count > 0 Then ActiveSheet.Sheet.DrawingDimensions.GeneralDimensions.Retrieve(FrontView, myDimColl)

Part 1: The logger outputs that the myDimColl has a count of 2 and two new dimensions appear on the drawing as anticipated. The main problem is I also get a General Note (that is associated with a skeletal part used in the top model) that appears in the top left corner of the drawing that I didn't ask for. If I change the code to only include one dimension or the other I still get the unwanted note so it's not part of either note and if I pass an empty collection I get an error so the note isn't being added to the collection. I can make more code to loop through and delete the note after the dimensions are added but I feel as though I shouldn't have to... Is this just a bug? 

Part 2: I couldn't get "GetRetrievableDimensions" to work with an actual "ComponentOccurrence" hence the "ComponentOccurrenceProxy" making, but the description for the optional model object says it works with CompOcc. Is that also a bug?

 

I know the code I gave is non-functioning as written and that makes it hard to debug but I'm not looking for tips for workarounds, I have working code. I just want to know if I'm fundamentally doing something wrong or fighting issues that shouldn't be issues.

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Reply
588 Views
0 Replies
Replies (0)