autocad vba编程中,设置了自定义ucs,为newucs,并且设置thisdrawing.a 100
autocadvba编程中,设置了自定义ucs,为newucs,并且设置thisdrawing.activeucs=newucs了,但是为什么画出的图形,还是按照在wcs...
autocad vba编程中,设置了自定义ucs,为newucs,并且设置thisdrawing.activeucs=newucs了,但是为什么画出的图形,还是按照在wcs中画出的。比如我想画ucs中2,3,0点,但实际还是在wcs中的 2,3,0点,这是什么原因
展开
展开全部
当前坐标系为用户坐标系后,通过程序输入的数据仍是原坐标系数据,虽然你认为是用户坐标系内的点.但程序却不认.这需要将用户坐标系内的坐标转成世界坐标系.函数式:
RETVAL=PBKECT.TRANSLATECOORDINATES(ORIGINALPOINT,FROM,TO,DISP[,OCSNORMAL])
例:
THISDRAWING.ACTIVEUCS=MYUCS
DIM POINTWCS AS VARIANT
POINTWCS=THISDRAWING.UTILITY.GETPOINT(,"ENTER A POINT")
DIM POINTUCS AS VARIANT
POINTUCS=THISDRAWING.UTILITY.TRANSLATECOORDINATES_(POINTWCS,ACWORLD,ACUCS,FALSE)
MSGBOX POINTWCS(0)
MSGBOX POINTUCS(0)
DIM PUCS(2) AS DOUBLE
DIM PWCS AS VARIANT
PWCS=THISDRAWING。UTILITY。TRANSLATECOORDINATES(PUCS,ACUCS,ACWORLD,FALSE)
DIM MYLINE AS ACADLINE
SET MYLINE=THISDRAWING。MODELSPACE。ADDLINE(PWCS,PWCS2)
RETVAL=PBKECT.TRANSLATECOORDINATES(ORIGINALPOINT,FROM,TO,DISP[,OCSNORMAL])
例:
THISDRAWING.ACTIVEUCS=MYUCS
DIM POINTWCS AS VARIANT
POINTWCS=THISDRAWING.UTILITY.GETPOINT(,"ENTER A POINT")
DIM POINTUCS AS VARIANT
POINTUCS=THISDRAWING.UTILITY.TRANSLATECOORDINATES_(POINTWCS,ACWORLD,ACUCS,FALSE)
MSGBOX POINTWCS(0)
MSGBOX POINTUCS(0)
DIM PUCS(2) AS DOUBLE
DIM PWCS AS VARIANT
PWCS=THISDRAWING。UTILITY。TRANSLATECOORDINATES(PUCS,ACUCS,ACWORLD,FALSE)
DIM MYLINE AS ACADLINE
SET MYLINE=THISDRAWING。MODELSPACE。ADDLINE(PWCS,PWCS2)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询