Dynamic block underflow

Dynamic block underflow

nrussell4CW5T
Contributor Contributor
710 Views
7 Replies
Message 1 of 8

Dynamic block underflow

nrussell4CW5T
Contributor
Contributor

So i made a dynamic block of a 2x2 light fixture, and it has a tag. i made a button in the toolbar for it and below is my macro:


*^C^C-layer;make;ltg;c;11;;;attreq;0;-insert;dynamic-2x2;_nea;\1;1;\0;torient;L;;0;;

 

This makes a layer, sets the attribute to default, inserts the block, then it uses the command TORIENT to reorient the attribute text to always be flat, so i can insert the 2x2 on angled ceilings. However, not always, but sometimes I'm getting an underflow error, and this didn't start happening until i made these blocks. When i get the underflow error, i cant use the TORIENT command anymore. I have to Save and close out of the drawing, but sometimes i cant save, because theres a random temp file that was made, so i have to delete the temp file and then i can save my drawing. when i close out and reopen, it works just fine, but i dont want that to happen. 


From my best guess, the * repeats the last command that was input. For our normal blocks it would have stopped before TORIENT, so the last command was insert, so we can keep inserting more blocks, but now that its TORIENT, i think its repeating the TORIENT command, doubling up on it causing the underflow. 

 

Does anyone know a fix to this? Is there a macro command that can restart the macro rather than just the last command? Or is there a way to have the Attribute in the block always be horizontal, regardless of the angle of the insertion point?

 

Also for testing purposes, might anyone know how to cause the underflow more consistently?

The snip below is the command line when i put the block in, and it does show that its calling the TORIENT twice. The blue line is just distinguishing one block insertion, below that is it repeating the macro and inserting another, to which i canceled. in total there are 2 clicks after pressing the toolbar button, 1 to place, and one to orient to the angle i desire. Also attached is the block if that's helpful. 

nrussell4CW5T_0-1759859133196.png

 

0 Likes
Accepted solutions (1)
711 Views
7 Replies
Replies (7)
Message 2 of 8

Brock_Olly
Advisor
Advisor

Try this:

*^C^C-layer;make;ltg;c;11;;;attreq;0;-insert;dynamic-2x2;_nea;\1;1;\0;torient;L;;0;^C;



The extra ^C at the end cancels TORIENT before the macro ends.
Now, when the macro restarts, the “last completed command” is INSERT, not TORIENT.

0 Likes
Message 3 of 8

nrussell4CW5T
Contributor
Contributor

Not quite, i want TORIENT to run and complete, but i only want it to run once. Ironically, trying to cancel the function caused it to call TORIENT a 3rd time lol

nrussell4CW5T_0-1759922100070.png

 

0 Likes
Message 4 of 8

Brock_Olly
Advisor
Advisor

Is it an option to not start with the asterix and click the button each time?

0 Likes
Message 5 of 8

nrussell4CW5T
Contributor
Contributor

Yes, but its just inefficient. Ill have a drawing where im inserting a few hundred light fixtures and i would prefer to not go back to the toolbar and click for a new one each time. So im looking for a solution, either with the macro coding, or with the block itself.

0 Likes
Message 6 of 8

Paul_Gander
Advocate
Advocate
Accepted solution

Try this, and make sure you don't have any extra spaces at the end of the macro:

*^C^C-layer;make;ltg;c;11;;;attreq;0;-insert;dynamic-2x2;_nea;\1;1;\torient;L;;0;

 

0 Likes
Message 7 of 8

nrussell4CW5T
Contributor
Contributor

This works! Torient is only called once now. Can you explain why removing the ";0\;" before Torient and just using ";\torient" works?

0 Likes
Message 8 of 8

Paul_Gander
Advocate
Advocate

The extra ; at the end of the macro was causing torient to be restarted. The zero in the middle was just not required because the \ was getting an angle supplied by the user. The zero was being treated as a new command, resulting in the 'Unknown command' error which can be seen in your screenshot of the command line history.

0 Likes