phjlc Posted July 4, 2022 Posted July 4, 2022 Hello, I really dont know if this is the appropriate board to post this, but Im having an issue regarding to my Dynamic block losing its field everytime I save, it is showing this error I always need to run this after i open (defun c:asd () (setq ssblck (ssget "x" (list '(0 . "INSERT"))) lpdtct 0 ) (repeat (sslength ssblck) (if (not (eq (vlax-get-property (vlax-ename->vla-object (ssname ssblck lpdtct)) 'effectivename ) "OIS-LVL-BLK" ) ) (progn (setq lpdtct (+ lpdtct 1))) (progn (SETQ d1 (ssname ssblck lpdtct) d2 (vlax-ename->vla-object d1) d3 (itoa (vla-get-objectid d2)) d4 (vlax-invoke d2 'getattributes) d5 (car d4) ;ffl d6 (cadr d4) ;lvl d7 (vlax-variant-value (vlax-get-property (nth 4 (vlax-invoke d2 'getdynamicblockproperties)) 'value ) ) ) (if (eq d7 1) (progn (command "move" d1 "" '(0 0 0) '(0 1212 0)) (setq lpdtct (+ lpdtct 1)) ) (progn (vlax-put-property d6 'textstring (strcat "+" "%<\\AcObjProp Object(%<\\_ObjId " d3 ">%).InsertionPoint \\f " "\"%lu2%pt4%pr3" "\">%" ) ) (vlax-put-property d5 'textstring (strcat "%<\\AcObjProp Object(%<\\_ObjId " d3 ">%).Layer \\f " "\"%tc1" "\">%" ) ) (setq lpdtct (+ lpdtct 1)) ) ) ) ) ) ) Thank you for anyone who will response. Quote
BIGAL Posted July 5, 2022 Posted July 5, 2022 (edited) Sometimes with this type of thing insert the block and as a second step up date it, so you would use (entlast) to get object then put dynamic properties. I know that for blocks must get the id every time as it must reflect the inserted block. You can not copy the block if you have set a ID. Why dynamic block does it do something special ? Where are the values coming from? You may need to post a real dwg. Edited July 5, 2022 by BIGAL 1 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.