CoordinateSystemFeatureData

Hello,

i write a new Function to bring me back the Origin of the selected CoordinateSystem. But i do not work

Public Function SetCoordSys(ByVal csys As String) As Boolean

     If m_ModelDoc Is Nothing Then

          Me.ErrTextKomp(My.Resources.FehlerTexte.DF_SwModeldocNothing, "SetCoordSys", ErrText)

          Return False

     End If

     SetCoordSys = False

     Dim boolstatus As Boolean

     Dim cSysData As CoordinateSystemFeatureData

     Dim CoordSys As Feature

     Dim geo As SldWorks.Entity

     'Koordinatensystem selektieren

     Dim swSelmgr As SldWorks.SelectionMgr = m_ModelDoc.SelectionManager

     boolstatus = m_ModelDoc.Extension.SelectByID2(csys, "COORDSYS", 0, 0, 0, False, 0, Nothing, 0)

     If boolstatus = True Then

          CoordSys = swSelmgr.GetSelectedObject6(1, -1) 'CoordSys is OK, i can see the right information

          cSysData = CoordSys.GetDefinition()

          geo = cSysData.OriginEntity()' This entry is nothing why???

     End If

     SetCoordSys = True

End Function

I want this information

Thank you for your support

Wilfried

Nachricht geändert durch Wilfried Pietzmarked wrong line

SolidworksApi macros