Ilogic drawing dimension

Ilogic drawing dimension

Anonymous
Not applicable
391 Views
2 Replies
Message 1 of 3

Ilogic drawing dimension

Anonymous
Not applicable

I am using this code create the dimension with parameter but get error when I put the variables in the Parameter. 

'Get active drawing document, sheet and view
Dim drwDoc As DrawingDocument = ThisDoc.Document
Dim drwSheet As Sheet = drwDoc.Sheets(1)
Dim drwView As DrawingView = drwSheet.DrawingViews(1)

'Get referenced assembly and its component definition
Dim asmDoc As AssemblyDocument = drwDoc.ReferencedDocuments(1)
Dim asmDef As AssemblyComponentDefinition = asmDoc.ComponentDefinition

'Get MateConstraint
Dim mateConstraint As MateConstraint = asmDef.Constraints("MateForDimension")

'Get face proxies from MateConstraint
Dim faceProxy1 As FaceProxy = mateConstraint.EntityOne
Dim faceProxy2 As FaceProxy = mateConstraint.EntityTwo

'Get DrawingCurves which belongs to face in appropriate DrawingView
Dim curves1 As DrawingCurvesEnumerator = drwView.DrawingCurves(faceProxy1)
Dim curves2 As DrawingCurvesEnumerator = drwView.DrawingCurves(faceProxy2)

'Select the right DrawingCurve
Dim curve1 As DrawingCurve = curves1.Item(1)
Dim curve2 As DrawingCurve = curves2.Item(1)

'Create GeometryIntent for this curve
Dim geometryIntent1 = drwSheet.CreateGeometryIntent(curve1)
Dim geometryIntent2 = drwSheet.CreateGeometryIntent(curve2)

'Select dimension text position
Dim textOrigin = drwView.Center

'Create DrawingDimension
drwSheet.DrawingDimensions.GeneralDimensions.AddLinear(textOrigin, geometryIntent1, geometryIntent2)

 

392 Views
2 Replies
Replies (2)
Message 2 of 3

floccipier
Advocate
Advocate

@Anonymous this is really creative way to access intent faces. Would you mind sharing what error you encounter?

0 Likes
Message 3 of 3

Anonymous
Not applicable

When I used the parameter which has variable in it. it will case error.

0 Likes