Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am working on some drawing automation. I have an ilogic rule that inserts a sketch symbol based on centermarks from the model. This all works fine. However I need a way to arrange these after they are inserted. I have the code below that returns all of the Y values for the sketch symbols. My thought is I need to make a list in ilogic for all of these and compare the values. How would I do this is the question? The model can any number of components located at various elevations as shown in attachment.
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument oDrawDoc.Update oSheets = oDrawDoc.Sheets Dim oSheet As Sheet Dim oViews As DrawingViews Dim oView As DrawingView Dim oSymbol As SketchedSymbol Dim oSymbols As SketchedSymbols For Each oSheet In oSheets For Each oSymbol In oSheet.SketchedSymbols If oSymbol.Definition.Name = "label" Then Dim oSymbPoint As Point2d oSymbPoint = oSymbol.Position ' MsgBox(oSymbPoint.x & " - " & oSymbPoint.y) 'next steps are: 'Create a list of all the oSymbPoint.y values and compare them to see if any overlap and how much (oSymbPoint.y +/- 1/16" to check overlap) 'If any overlap move them and retest to make sure the move didn't cause any others to overlap 'Keep checking and moving until none overlap End If Next Next 'Code below for moving the sketch symbol' ' Set a reference to the TransientGeometry object.' Dim oTG As TransientGeometry' oTG = ThisApplication.TransientGeometry' ' 'Move the sketch symbol if it is too close to another one.' Dim oNewPoint As Point2d' oNewPoint = oTG.CreatePoint2d(oSymbPoint.x, oSymbPoint.y + 1) The "+1" would be the amount of overlap' oSymbol.Position = oNewPoint
Solved! Go to Solution.