Jump to content

Recommended Posts

Posted

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, 

 

image.png.9760bd968658327631fcb37b8b9654cc.png       image.png.ee6812460e6efa23ce7c76846bdb1708.png

 

it is showing this error

 

image.png.5db833da0d7c134c2a0a88699ccad367.png

 

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. 

 

Posted (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 by BIGAL
  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...