- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm using iLogic to create a drawing with annotations, this works fine using the workpoints method, simplified example below:
Dim oWP1 As WorkPoint = oWorkPoints.Item("WP1name") 'Define workpoints
Dim oWP2 As WorkPoint = oWorkPoints.Item("WP2name")
Dim oV1Cm1, oV1Cm2 As CenterMark 'Create centermarks on workpoints
oV1Cm1 = oCMs.AddByWorkFeature(oWP1, oView1)
oV1Cm2 = oCMs.AddByWorkFeature(oWP5, oView1)
Dim oV1Int1 As GeometryIntent = oSheet.CreateGeometryIntent(oV1Cm1) 'create geom intents
Dim oV1Int2 As GeometryIntent = oSheet.CreateGeometryIntent(oV1Cm2)
oPtText_V1_p1 = oTG.CreatePoint2d(oView1.Center.X, (oView1.Top + 1)) 'annotation position for placement
oDimTypeH = DimensionTypeEnum.kHorizontalDimensionType 'horizontal placement 'annotation orientation
oV1Dim1 = Sheet.DrawingDimensions.GeneralDimensions.AddLinear(oPtText_V1_p1, oV1Int1, oV1Int2, oDimTypeH) 'place annotation
In some configurations of the assembly specific Parts are supressed, but the iLogic code still creates the Centremarks of the supressed Parts, leaving some floating marks without annotation on my drawing, example below.
This is no big problem, but it would be more stylish to not show these in case the part they originate from is supressed, to achieve this i tried the following:
use some simple logic to check if the part is supressed, E.g.
If part1 = unsupressed
Dim oWP1 As WorkPoint = oWorkPoints.Item("WP1name") 'Define workpoints
Dim oWP2 As WorkPoint = oWorkPoints.Item("WP2name")
else
end if
'rest of the code...
This failed, which makes sense, because the centermarks cant be created if theres no workpoints to create them from. I would basically have to repeat this 'if statement check' for every single step in creating the annotation, because otherwise the next step will throw an error, this is not ideal...
So my question:
Is there a simpeler way of removing these unused centermarks? Any ideas?
Looking for some general simple solution i can put in the end of my code if possible:
For Each CenterMark in oDrawingDoc
If Centremark = *something* Then ' *something* = not used as basepoint for creating a linear dimension
CenterMark.Supress
End if
Next
Solved! Go to Solution.