马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
许多人以为activex方式很麻烦。
很简单。
看下面的代码,从现在开始,可以告别entget,不用记dxf组码了。
- [FONT=courier new]
- (defun point->list (point)
- (vlax-safearray->list (vlax-variant-value point))
- )
- (defun c:test()
- (setq line (car (entsel)))
- (setq line (vlax-ename->vla-object line))
- (setq objectname (vla-get-objectname line))
- (setq startpoint (vla-get-startpoint line))
- (setq endpoint (vla-get-endpoint line))
- (setq layername (vla-get-layer line))
- (setq len (vla-get-length line))
- (setq thickness (vla-get-thickness line))
- (princ "\nObject Name: ")(princ objectname)
- (princ "\nStart Point: ")(princ (point->list startpoint))
- (princ "\nEnd Point: ")(princ (point->list endpoint))
- (princ "\nLayer: ")(princ layername)
- (princ "\nLine Length: ")(princ len)
- (princ "\nThickness: ")(princ thickness)
- (princ)
- )
- [/FONT]
|