samifox Posted May 31, 2014 Posted May 31, 2014 Hi my program interviews the user and send the info to a dynamic block with attributes, i have some questions 1.how to communicate with the attributes so i can set their text? 2.how can i eliminate the default behavior of inserted blocks which is to set attributes first before the block is actually inserted. i've attached the block for your convenience Thanks Shay (vl-load-com) (defun C:tst (/ stpt edpt vla-blk ss) (if (setq stpt (getpoint "\nclick start point")) (if (setq edpt (getpoint stpt "\nclick end point")) (progn (command "-insert" "re1" stpt "1" "" "0" "" "") (setq vla-blk (vlax-ename->vla-object (entlast))) (setq ss (ssadd (entlast))) (sssetfirst nil ss) (LM:setdynpropvalue vla-blk "Pin Length" 15) (LM:setdynpropvalue vla-blk "Rebar Length" 600) (LM:setdynpropvalue vla-blk "Angle" (angle stpt edpt)) ) ) ) ) ;; Set Dynamic Block Property Value - Lee Mac ;; Modifies the value of a Dynamic Block property (if present) ;; blk - [vla] VLA Dynamic Block Reference object ;; prp - [str] Dynamic Block property name (case-insensitive) ;; val - [any] New value for property ;; Returns: [any] New value if successful, else nil (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) ) ) insert_block.LSP Quote
pBe Posted May 31, 2014 Posted May 31, 2014 Hi2.how can i eliminate the default behavior of inserted blocks which is to set attributes first before the block is actually inserted. For item number two, since you area using the command "_insert", look into ATTREQ system variable. BTW: where is the attached block? Quote
samifox Posted June 1, 2014 Author Posted June 1, 2014 BTW: where is the attached block? rebar_insert.dwg 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.