Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anyone help to create code for adding feature control frame to general dimension. sample feature control given below
Solved! Go to Solution.
Can anyone help to create code for adding feature control frame to general dimension. sample feature control given below
Solved! Go to Solution.
I think that the following rule will do precisely what you want. But it is not very flexible. It will turn the feature control frame always 90 deg also if you don't want it for other dimensions. And it's moved to the left from the dimension text. That is only good if you have a vertical dimension. For horizontal dimensions that is not good...
Dim oTg = ThisApplication.TransientGeometry Dim doc As DrawingDocument = ThisDoc.Document Dim sheet As Sheet = doc.ActiveSheet Dim dimension = ThisApplication.CommandManager.Pick( SelectionFilterEnum.kDrawingDimensionFilter, "Select a VERICAL dimension") Dim rows As FeatureControlFrameRows = sheet.FeatureControlFrames.CreateFeatureControlFrameRows() rows.Add(GeometricCharacteristicEnum.kPosition, "Ø0.02", "", "A") Dim pointCollection = ThisApplication.TransientObjects.CreateObjectCollection() Dim textPoint = dimension.Text.Origin ' move the FeatureControlFrame away from the text. Dim position As Point2d = oTg.CreatePoint2d( textPoint.X + 1, textPoint.Y) pointCollection.Add(position) ' Add the next 2 lines if you want a leader 'Dim intent = sheet.CreateGeometryIntent(dimension, dimension.DimensionLine.MidPoint) 'pointCollection.Add(intent) Dim fcf = sheet.FeatureControlFrames.Add(pointCollection, rows) fcf.Rotation = (Math.PI / 180) * 90
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.
Blog: hjalte.nl - github.com
This is iLogic code (or to be exact VB.net code). It would be better if you did not write VBa any more. VBa is obsolete. (But for now you can still make it work...) For more information see this blog post "Is VBA in Inventor obsolete?"
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.
Blog: hjalte.nl - github.com