Message 1 of 3
Ilogic drawing dimension

Not applicable
08-13-2021
12:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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)