Romero Posted August 16, 2018 Posted August 16, 2018 Hi. Maybe someone here in this forum can help me. I'm trying to set the distance for a dynamic block of a single parameter; which is linear and is called Distance1. I do not know what I'm doing wrong, but I can not do it and change the desired distance. He helped me with the functions of Lee Mac, but something is wrong. Any help very similar, I will be completely grateful. (defun c: ddd (/ obj dd) (if (y (setq obj (car (entsel "\ ndynamic block:") (setq dd (getdist "\ Length:")))) (= "AcDbBlockReference" (vla- get-objectname (setq obj (vlax-esame-> vla-object obj)))) (=: vlax-true (vla-get-isdynamicblock obj)) ) (LM: setdynpropvalue obj "Distance1" dd) ) (princ) ) (defun LM: setdynpropvalue (blk prp val) (setq prp (strcase prp)) (vl-some '(lambda (x) (if (= prp (strcase (vla-get-propertyname x))) (progn (vla- put-value x (vlax-make-variant val (vlax-variant-type (vla-get-value x)))) (cond (val) (t)) ) ) ) (vlax-invoke blk 'getdynamicblockproperties) ) ) (vl-load-com) (princ) Quote
Tharwat Posted August 16, 2018 Posted August 16, 2018 Hi, Try this function. (defun set:distance (blk dis) (vl-some '(lambda (x) (and (eq "Distance1" (vla-get-propertyname x)) (vlax-put x 'Value dis)) ) (vlax-invoke (vlax-ename->vla-object blk) 'getdynamicBlockproperties) ) ) (vl-load-com) Usage of above function: (set:distance <BlockEntityName> <DistanceValue>) 1 Quote
Roy_043 Posted August 16, 2018 Posted August 16, 2018 Wow, the OP raises cross posting to a whole new level.:( 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.