dimension sheet metal drawing

dimension sheet metal drawing

Anonymous
Not applicable
3,672 Views
3 Replies
Message 1 of 4

dimension sheet metal drawing

Anonymous
Not applicable
I want to programatically add general dimensions to several Inventor 10 drawings created from sheet metal flat patterns. The features that require dimensions are lines on the Visible Edges and Sheet Metal Bend Centerlines layers. How do I iterate through the collection of features on these layers to determine line start and end points that I can use to create the dimensions?

Thanks,
Bruce
0 Likes
3,673 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Bruce,

You will need to iterate over all the draawing curves that belong to a view
and select the ones that are on layer(s) of interest. Your code may look
something like this:

Sub DrawingCurves()

Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oDrawingView As DrawingView
Set oDrawingView = oDoc.ActiveSheet.DrawingViews.Item(1)

Dim oDrawingCurve As DrawingCurve

For Each oDrawingCurve In oDrawingView.DrawingCurves

Dim oDrawingCurveSegment As DrawingCurveSegment
For Each oDrawingCurveSegment In oDrawingCurve.Segments
If oDrawingCurveSegment.Layer.Name = "Visible (ANSI)" Then
' Do something...
End If
Next
Next

End Sub

Sanjay-

wrote in message news:5417070@discussion.autodesk.com...
I want to programatically add general dimensions to several Inventor 10
drawings created from sheet metal flat patterns. The features that require
dimensions are lines on the Visible Edges and Sheet Metal Bend Centerlines
layers. How do I iterate through the collection of features on these layers
to determine line start and end points that I can use to create the
dimensions?

Thanks,
Bruce
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks, Sanjay, but I don't see the DrawingCurve object in the Inv10 API. Is this an Inv11 object?

Bruce
0 Likes
Message 4 of 4

Anonymous
Not applicable
Access to drawing curves was added in Inventor 11. Placement of drawing
dimensions was also added in Inventor 11. The only workaround that I'm
aware of is to create a sketch in the drawing, place sketch points at the
locations that correspond to the positions on the model you want to
dimension to, place dimension constraints to those points, and then finally
retrieve those dimension constraints into the drawing as a drawing
dimension. This approach has several problems, one of the biggest being
that the dimensions are not associated to the model, but it's the only
workaround that I'm aware of to get place dimensions using the API in
Inventor 10.
--
Brian Ekins
Autodesk Inventor API
0 Likes