Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Josh_Hunt
1385 Views, 7 Replies

DrawingView.SetIncludeStatus where is my centerline/centermark?

 

My function creates the centerline or centermark as expected. SetIncludeStatus does not return an object and I need to resize and dimension to the centerline or centermark.

 

    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
        
        'includes objects
        dv.SetIncludeStatus(includeObj, True)
        
        ''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 Function

 

The end of my function tries to find what was just created by looking at the ModelWorkFeature. But I have 2 problems...

  • I don't know if it created a centerline or centermark.
  • I will have projected views that create a centerline or centermark using the same Axis.

Any ideas, about how to find what I just created?

Josh Hunt