![]() |
objectarx 座标转换
objectarx 座标转换
www.dimcax.com objectarx 座标转换 网上看到很多人在找关于objectarx 座标转换问题的解决方法,可以先将点转换,也可将实体转换,以下代码是在屏幕上获取一个点,并转换到wcs。 <commandmethod("uptwp")> public function ucspointtowcspoint() as point3d dim ed as editor = application.documentmanager.mdiactivedocument.editor dim ptopts as new promptpointoptions("enter start point") dim mt as matrix3d = ed.currentusercoordinatesystem dim ptres as promptpointresult = ed.getpoint(ptopts) dim ucspoint3d as point3d = ptres.value dim wcspoint3d as point3d = ucspoint3d.transformby(mt) return wcspoint3d end function 复制代码 [ ''' <summary>从ucs转换到wcs。</summary> ''' <param name="t">要转换的点.</param> public shared function ucstowcs(byval pt as point3d) as point3d dim ed as editor = application.documentmanager.mdiactivedocument.editor dim mt as matrix3d = ed.currentusercoordinatesystem dim newpoint as point3d = pt.transformby(mt) return newpoint end function ''' <summary>从wcs转换到ucs。</summary> ''' <param name="t">要转换的点.</param> public shared function wcstoucs(byval pt as point3d) as point3d dim db as database = application.documentmanager.mdiactivedocument.database dim vect as vector3d = db.ucsorg.getvectorto(new point3d(0, 0, 0)) dim mt as matrix3d = matrix3d.displacement(vect) dim newpoint as point3d = pt.transformby(mt) return newpoint end function 复制代码 [ good take! |
所有的时间均为北京时间。 现在的时间是 04:04 AM. |