03-01-2018
11:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-01-2018
11:54 PM
Sure, below is the code for the same.
Function CreateCLine(Sht As Sheet, dv As DrawingView, occ As Object, AxisName As String) As Centerline
Dim docDesc As DocumentDescriptor = dv.ReferencedDocumentDescriptor
Dim Doctype As DocumentTypeEnum = docDesc.ReferencedDocumentType
'get objects
If Doctype = DocumentTypeEnum.kPartDocumentObject
includeObj = occ.Definition.WorkAxes(AxisName)
Else ''assembly, so GET PROXY OF OCCURRENCE
includeObj = ASI_.getWorkAxisProxy(occ, AxisName)
End If
DIm oCMStatus as Boolean
oCMStatus = false
Dim oCLStatus as Boolean
oCLStatus = false
DIm cmCnt as integer
cmCnt = Sht.CenterMarks.Count
Dim clCnt as integer
clCnt = Sht.Centerlines.Count
'includes objects
dv.SetIncludeStatus(includeObj, True)
If Sht.Centermarks.Count > cmCnt Then
oCMStatus = True
Else If Sht.Centerlines.Count > clCnt Then
oCLStatus = True
End If
''find centerline that was just created
Dim newCL As Centerline
For Each CL As Centerline In Sht.Centerlines
If CL.ModelWorkFeature Is includeObj
newCL = CL
Exit For
End If
Next
Return newCL
End FunctionThanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
