ARGV Posted November 24, 2008 Posted November 24, 2008 Hi. Does anyone know if dynamic blocks contain difference DXF codes or any way of differentiating between regular blocks and dynamic blocks. thanks! Quote
ASMI Posted November 24, 2008 Posted November 24, 2008 ActiveX object of block has IsDynamicBlock property. Command: (vl-load-com) Command: (setq vlaBl(vlax-ename->vla-object(car(entsel)))) Select object: #<VLA-OBJECT IAcadBlockReference 0e83853c> Command: (vla-get-IsDynamicBlock vlaBl) :vlax-true Quote
ARGV Posted November 24, 2008 Author Posted November 24, 2008 ActiveX object of block has IsDynamicBlock property. Command: (vl-load-com) Command: (setq vlaBl(vlax-ename->vla-object(car(entsel)))) Select object: #<VLA-OBJECT IAcadBlockReference 0e83853c> Command: (vla-get-IsDynamicBlock vlaBl) :vlax-true Cool, I can handle that. thank you. Quote
ARGV Posted November 24, 2008 Author Posted November 24, 2008 ActiveX object of block has IsDynamicBlock property. Command: (vl-load-com) Command: (setq vlaBl(vlax-ename->vla-object(car(entsel)))) Select object: #<VLA-OBJECT IAcadBlockReference 0e83853c> Command: (vla-get-IsDynamicBlock vlaBl) :vlax-true Is there any more information you can get about the dynamic block? Such as it's visibility or what type of action it uses? Quote
flowerrobot Posted November 27, 2008 Posted November 27, 2008 a little off topic, but how would you insert a dynamic block, and then eddit the attributy things, eg length and angle of a dynamic polor strech? hence so this can become a lisp, select 1 points and works out angle and length? cheers Quote
ASMI Posted November 27, 2008 Posted November 27, 2008 Is there any more information you can get about the dynamic block? Such as it's visibility or what type of action it uses? eg length and angle of a dynamic polor strech?hence so this can become a lisp, select 1 points and works out angle and length? cheers This code can to copy visibility state from one block to others, try to analize it: http://www.asmitools.com/Files/Lisps/Vico.html There is two function to get and put dynamic property: (vl-load-com) (defun GetDynamicProperty(Block Property / oVal) (if(= 'ENAME(type Block)) (setq Block(vlax-ename->vla-object Block)) ); end if (if(= :vlax-true(vla-get-IsDynamicBlock Block)) (foreach p(vlax-safearray->list (vlax-variant-value (vla-GetDynamicBlockProperties Block))) (if(=(strcase Property)(strcase(vla-get-PropertyName p))) (if(vl-catch-all-error-p (setq oVal(vl-catch-all-apply 'vla-get-Value(list p)))) nil (setq oVal(vlax-variant-value oVal)) ); end if ); end if ); end foreach ); end if oVal ); end of GetDynamicProperty (defun PutDynamicProperty(Block Property Value / oVal cVal) (if(= 'ENAME(type Block)) (setq Block(vlax-ename->vla-object Block)) ); end if (if(= :vlax-true(vla-get-IsDynamicBlock Block)) (foreach p(vlax-safearray->list (vlax-variant-value (vla-GetDynamicBlockProperties Block))) (if(=(strcase Property)(strcase(vla-get-PropertyName p))) (progn (setq cVal(vlax-make-variant Value vlax-vbDouble)) (if(vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Value(list p cVal))) (setq oVal nil)(setq oVal Value) ); end if ); end progn ); end if ); end foreach ); end if oVal ); end of GetDynamicProperty Testing with dynamic block witn standard "Distance" property: Get block ename: (setq bl(car(entsel))) Select object: <Entity name: 7efa3390> Get property "Distance": Command: (GetDynamicProperty bl "Distance") 667.536 Resize block with puting new "Distance" value: Command: (PutDynamicProperty bl "Distance" 100.0) 100.0 Excuse me guys. It isn't short conversation and I havn't today more time. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.