马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 marting 于 2017-7-18 22:38 编辑
 - (defun c:extract() ; by Fenton Webb and Wayne Brill, DevTech, 08/Jan/2007
-
- ; make sure com is loaded
- (vl-load-com)
- ; get the acad application object
- (setq AcadApp (vlax-get-acad-object))
- ; now from that get the active document
- (setq AcadDoc (vla-Get-ActiveDocument AcadApp))
- ; now get the utility object so we can select an entity
- (setq UtilObj (vla-Get-Utility AcadDoc))
- ; now pick the block ref
- (vla-GetEntity UtilObj 'BlockRefObj 'selPt)
- ; so is this def a block ref
- (if (equal (setq ObjType (vla-Get-ObjectName BlockRefObj))
- "AcDbBlockReference")
- (progn
- ; now get the dynamic block's properties
- (setq dynProps (vlax-variant-value (vla-getDynamicBlockProperties BlockRefObj )))
- (setq lBound (vlax-safearray-get-l-bound dynProps 1))
- (setq uBound (vlax-safearray-get-u-bound dynProps 1))
- (setq aCounter lBound)
- (while (<= aCounter uBound)
- (setq obj (vlax-safearray-get-element dynProps aCounter))
- (princ "\nPropertyName ")
- (princ "\n")
- (princ (vla-get-PropertyName obj))
- (princ "\nDescription ")
- (princ (vla-get-Description obj))
- (princ "\nReadonly ")
- (princ (vla-get-readonly obj))
- (princ "\nshow ")
- (princ (vla-get-show obj))
- (princ "\nvalue ")
- (princ (vla-get-value obj))
-
- (setq aCounter(1+ aCounter))
-
- )
-
- );progn
- );if
-
- ; now release everything to make sure
- (if UtilObj
- (progn (vlax-Release-Object UtilObj) (setq UtilObj nil))
- )
- (if AcadDoc
- (progn (vlax-Release-Object AcadDoc) (setq AcadDoc nil))
- )
- (if AcadApp
- (progn (vlax-Release-Object AcadApp) (setq AcadApp nil))
- )
- (princ)
- );defun
|