Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic Block Stretch Error

10 REPLIES 10
Reply
Message 1 of 11
bspittman97
1303 Views, 10 Replies

Dynamic Block Stretch Error

I select the block to highlight the grips. I use a stretch grip to stretch the block. The block looks horrible. Lines are partially stretched or not stretched at all. So I leave it highlighted and type "bedit" at the command line. I enter block editor - I've learned that I have to change something no matter how small or insignificant. I've learned that all I have to do is change the zoom, so I give my scroll wheel a little 'flick'. Then I exit the block editor, saving changes. When it goes back to the drawing, the block has repaired itself and looks correct.

This has been going on for years. From talking to co-workers, I may actually have a work-around now. In my LISP program that inserts the block (I have a few that do this, but not every time) I think it might work if I immediately erase the block and then insert it again. But this hasn't been proven yet.

 

Anyone have a solution?

 

 

10 REPLIES 10
Message 2 of 11
j.palmeL29YX
in reply to: bspittman97

Here I can't see problems: https://autode.sk/2wPuGdE 

Both the testblock in the block editor and after inserting into a new drawing all seems to work well.

 

Therefore only a shot into the dark: Have you installed the current updates?

Or we need more informations ... (e.g. where do you insert the block [which coordinates], have you the problem also in the origin WBLOCK drawing [Testblock] or only when inserted into any drawing, ...)

 

 

cadder

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 11
Anonymous
in reply to: bspittman97

I can't replicate this problem either. Your block works fine for me. Have you tried using the command "REGEN"?

This usually fixes the little visual bugs. Do your coworkers also experience this problem on there computers?
What version of AutoCAD are you running?

Message 4 of 11
neaton
in reply to: Anonymous

I can't get it to break, either. Does this happen when you insert the block into a new drawing?

Is it being used from within a template or being inserted from an external file? If you WLBOCK the block then redefine it in the drawing by inserting from the saved location does it still break?

Try using the RESETBLOCK command (Select block, right-click, Reset Block) instead of opening the block.

 

Message 5 of 11
bspittman97
in reply to: neaton

Thanks for the RESETBLOCK suggestion, I hadn't heard of that. Regen has no effect on it. We have a template drawing, but the template has no definition for this block. It gets inserted from a separate drawing file. It gets inserted by an Autolisp program I wrote using vla-insertblock. It doesn't happen every time to every drawing on every machine. It is frustratingly random. We're all on A2018, I'm 99% sure we all have patches installed, etc. There's about 5 users of it. It's been going on for about 5 years now, I keep updating to the current autocad hoping it's resolved and it just keeps happening. I've been ignoring it, but after all these years I just discovered that when it happens it leads directly to a crash of my program. That's annoying and it could lead to mistakes on the drawing sets.

OK, I just tried a few things - I think the resetblock works. This seems like a better workaround than deleting the block and re-inserting it like I was thinking. So every time I call a vla-insertblock, I'll call the resetblock as well. I think that's as good a solution as I was hoping for. I shouldn't have to do it, but there are many workarounds in my programs that I shouldn't have to do. Thanks,

Message 6 of 11
bspittman97
in reply to: bspittman97

This issue has risen to the top of my task list again. The reset block suggestion that I thought worked, did not work. Regen is too easy for this. And while I super appreciate the suggestions about updates and versions, I can assure you this has been ongoing for many years. Most of my coworkers are on 2018 (the issue predates that), a small handful is on 2019, I'm currently running 2020 and will be downloading the 2021 release soon. It's across the board. I also appreciate and understand the questions about templates or clean drawings - I've been working the past 6 months to make sure all my stuff is stand-alone and that I don't have hidden/forgotten routines anywhere. I've installed it on machines that have never met me, so to speak. The attached screencast is done on a clean drawing after having just done a reset.

 

To help you recreate the problem so that you can see it on your own screen, I've cut out a small snippet of my code and made it independent. I'm going to attach a different block here. The code asks for the location on your machine and then inserts it 3 times. The code does some customization, setting a lookup table value and populates a few attributes. And I'm going to attach another screencast. SUPER weird behavior - I didn't even know it was doing. The third block behaves differently than the first 2. I'm assuming you know AutoLISP - you can see you type "dropin" to run it.

 

Oh- I almost forgot. We read a post on a forum yesterday that basically said "You can't use basepoint parameters in dynamic blocks. They're broken, they don't work." We looked and found that I had them in the affected blocks, so I was super excited and took them out last evening and today. Didn't help. I thought it did, but then ran through the whole program and no good. I keep focusing on the block, but for all I know you're going to look at this code and say "you can't do THAT!!!" That's half of why I cut this snippet out for you, and the other half is to make sure you can reproduce the error. It worked for me too, if all I did was use the manual insert command. It has to be through the program. So I'm please I can reproduce it with this code. You should be able to as well. Right?

 

(DEFUN c:dropin	(/	A      BLOCKNAME     I#	   INDEX
		 OCA	OCN    PT     S#     T1	    TEXT   TOTMODS
		 VOBJECT       X
		)
  (vl-load-com)
  (setq	oca	  '((18 18 18 18) (18 18 18 18 19) (17 17 17 17))
	INDEX	  1
	T1	  NIL
	pt	  '(0 0)
	BLOCKNAME (getfiled "Select Block" "" "dwg" 16)
	oca	  '((19 19 19 19) (18 18 18 18) (19 19 18 18))
	ocn	  '((1) (2) (3))
  )					;SETQ
  (FOREACH A OCA
    (SETQ vobject
		  (vla-insertblock
		    (vlax-get-property
		      (vla-get-activedocument (vlax-get-acad-object))
		      'modelspace
		    )
		    (vlax-3D-point (trans pt 1 0))
		    blockname
		    1.0
		    1.0
		    1.0
		    0.0
		  )
	  INDEX	  1
	  text	  nil
	  totmods 0
	  i#	  (car (nth (vl-position a oca) ocn))
	  s#	  1
    )					;setq
    (mapcar
      '(lambda (x)
	 (if (= "Lookup1" (vla-get-propertyname x))
	   (vla-put-value
	     x
	     (vlax-make-variant
	       (length A)
	       (vlax-variant-type (vla-get-value x))
	     )
	   )
	 )
       )
      (vlax-invoke vobject 'getdynamicblockproperties)
    )
    (FOREACH B A
      (SETQ TEXT    (APPEND TEXT
			    (LIST (CONS	(STRCAT	"STRING"
						(ITOA (- (length A) 3))
						"-"
						(ITOA INDEX)
					)
					(STRCAT	"INV"
						(if (= (strlen (itoa i#)) 1)
						  (strcat "0" (itoa i#))
						  (itoa i#)
						)
						"-"
						"S"
						(if (= (strlen (itoa s#)) 1)
						  (strcat "0" (itoa s#))
						  (itoa s#)
						)
						":("
						(itoa b)
						")"
					)
				  )
			    )
		    )
	    INDEX   (1+ INDEX)
	    totmods (+ totmods b)
	    s#	    (1+ s#)
      )					;SETQ
    )					;FOREACH
    (SETQ TEXT (APPEND TEXT
		       (LIST (CONS "SUB-ARRAY-LINE-1"
				   (strcat "("
					   (itoa totmods)
					   ") BOB'S AWESOME MODULES"
				   )
			     )
		       )
	       )
	  TEXT (APPEND TEXT
		       (LIST (CONS "ES#"
				   (strcat (ITOA (1+ (CADR A)))
				   )
			     )
		       )
	       )
    )					;setq
    (mapcar
      '(lambda (x)
	 (if (assoc (vla-get-tagstring x) text)
	   (vla-put-textstring
	     x
	     (cdr (assoc (vla-get-tagstring x) text))
	   )
	 )
       )
      (vlax-invoke vobject 'getattributes)
    )					;mapcar
    (SETQ PT (POLAR PT (* PI 1.5) 3)
    )
  )
)					;dropin

 

Message 7 of 11
bspittman97
in reply to: bspittman97

My screencast of it didn't display. Trying again.

Message 8 of 11
bspittman97
in reply to: bspittman97

Another attempt to get the screencast out for you.

Message 9 of 11
Libbya
in reply to: bspittman97

While this relates to dynamic blocks, I do not think it is a dynamic block issue.  The block itself works fine.  The issue seems to be a result of the custom code.  You'd probably have better luck getting an answer if you posted it to one of the customization forums that deals with code.  

Message 10 of 11
Dave
in reply to: bspittman97

I am watching this thread, I've been having this same issue with inserted dynamic blocks for years.  I am currently running AutoCAD LT 2021 but it has occurred with previous versions of LT as well.  It is always a stretch parameter that is "out of whack" and although reset works, if you have multiple instances of that same block, going through and resetting each one is cumbersome.  I'm not able to add custom LISP so I have found that editing the stretch parameter in the block by modifying the selection set fixes all errant blocks at once.  Hopefully there is a solution as it is a real nuisance.

Message 11 of 11
bspittman97
in reply to: Dave

I have no input for you on LT. I'm tackling it from a programmatic perspective. At this point, I think I have it. But haven't gotten confirmation yet from my co-workers. Half of the blocks, I reset the blocks. The other half, I have to record all their attributes and dynamic block parameters, erase the block, re-insert it, reset the block again, re-populate all that data. And if that's not frustrating enough, if I do all that on the first set of blocks (the ones that resetting is enough), then it actually makes things worse and breaks them again.

 

My Autolisp program inserts about a dozen blocks. The insertion command used to execute in a couple of seconds, now it's out to about 20 seconds. I have some users who can't wait that long, so they press escape. Then they try to call me, we're not together anymore because the constitution was suspended in the US. A phone call can take hours or days for us to connect and I'm finding it difficult to convince them that 20 seconds of patience solves all their problems. They don't believe it.

 

I actually got an AutoDesk human to look at my screencast and 'escalate' it to someone else. He also asked me to start a developer ticket. I haven't asked yet where the link on that is. I could actually send them a few dozen tickets. Most have easier work-arounds, so I don't consider them annoying. I know - no help here. Maybe ACAD 2022 will fix it, now they know it's there.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services