Attach SurfaceTextureSymbol to DiameterGeneralDimension
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
After learning Inventor 2010 VBA over past year, I was able to create almost every macro I need for my work (print/convert all, drawing/part copy, automatic dimensioning etc...), mostly thanks to excellent built-in help in Inventor and plenty of very useful examples on internet.
But one important thing, which I cannot accomplish (or find anywhere) is to automatically create surface texture symbol and ATTACH it to diameter dimension.
Problem is with defining geometry Intent to attach surface texture symbol to. I am not able to get text extension line data (DiameterGeneralDimension object only has .dimensionline which is linesegment2D inside of hole geometry curve).
Only way I found, to create surface texture where I want it (under center of text on extension line), is If I create surface texture symbol manually, attach it to this point and then, by using selectset, I can get intent to which surface texture leader(1) is attached to. Then I can use this Intent to create another surface texture on the same spot. (Which is obviously not useful for automation)
So my question is: Is it possible to attach surface texture symbol to dimension text extension line using VBA? And if so, How?
Bellow is Function I use to create surface texture with ladder near dimension text (best I was able to achieve without error)
Public Function Pridej_drsnost_ke_kote(ByVal oPrumer_Kota As DrawingDimension)
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oActiveSheet As sheet
Set oActiveSheet = oDrawDoc.ActiveSheet
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
Dim oLeaderPoints As ObjectCollection
Set oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection
Call oLeaderPoints.Add(oTG.CreatePoint2d(oPrumer_Kota.Text.Origin.x + 0.5, oPrumer_Kota.Text.Origin.y - 1.5))
Call oLeaderPoints.Add(oTG.CreatePoint2d(oPrumer_Kota.Text.Origin.x + 0.8, oPrumer_Kota.Text.Origin.y - 1.8))
Dim oSymbol As SurfaceTextureSymbol
Set oSymbol = oActiveSheet.SurfaceTextureSymbols.Add(oLeaderPoints, kMaterialRemovalRequiredSurfaceType, False, False, False, "1,6")
End FunctionThis is the result which I would like to achieve:
Thank you very much
Best Regards
Daniel
