I am attempting to insert a block that contains two attributes. I would like to create a button for it, so I have made a macro but whenever I run this macro my top attribute shifts and relates itself to the origin of the UCS. The odd thing is that the bottom attribute does not, and this only happens when I insert this block through a macro. If I insert it through the insert command it comes out okay, but that is only if I did not try the macro already in the drawing. Quite odd.
The macro I used is:
C^C^C-LAYER;SET;"ELEVATION";;^C^C^C-INSERT;"ELEVATION - MODEL";\
I have also tried:
C^C^C-LAYER;SET;"ELEVATION";;^C^C^C-INSERT;"ELEVATION - MODEL";scale;1;rotate;0;
I have attempted to recreate the top attribute in model space, and in block editor. Copy/Mirror the bottom attribute in model space and block editor and redefine the values to what I want. I have also tried setting the UCSICON to noorigin and off in the block editor.
If anyone has any suggestions that would be great! Thank you!
I have attached the file below.
Solved! Go to Solution.
Solved by ryled. Go to Solution.
There is an attribute mode called "locked"
Can you lock these attributes in place, for all of your blocks?
I would think that to be the quickest/easiest solution...
I have both top and bottom attributes lock position set to yes, which is why I believe it works when using the "insert" command, but I would think it would be the same for the "-insert" command but that doesn't seem to be the case.
If this would be better suited in another section could someone point me in the right direction? I dont want to make multiple threads on the same topic.
Hi ryled,
"whenever I run this macro my top attribute shifts and relates itself to the origin of the UCS"
I can't reproduce that behavior, using
^C^C-LAYER;SET;"ELEVATION";;-INSERT;"ELEVATION - MODEL";\
or
^C^C-LAYER;SET;"ELEVATION";;-INSERT;"ELEVATION - MODEL";scale;1;rotate;0;
at AutoCAD 2010 and 2014...
Henrique
hmsilva,
Are you able to insert the block at all? I have attached a second block with the same problem. One of the annotative attributes shifts when it is inserted through a macro but the other one stays in place. If you insert it through the ribbon, either block, the attributes appear in the correct position. However if I used a macro, or just run it through the command line with "-Insert" one of the attributes shifts and relates its position to the origin. Perhaps this would be better suited in the dynamic blocks forum, but I thought it was possibly something incorrect I had done in my macro.
Running AutoCAD 2012 here for the record.
@ryled wrote:
Are you able to insert the block at all?
Yes.
@ryled wrote:
I have attached a second block with the same problem. One of the annotative attributes shifts when it is inserted through a macro but the other one stays in place. If you insert it through the ribbon, either block, the attributes appear in the correct position. However if I used a macro, or just run it through the command line with "-Insert" one of the attributes shifts and relates its position to the origin. Perhaps this would be better suited in the dynamic blocks forum, but I thought it was possibly something incorrect I had done in my macro.
Running AutoCAD 2012 here for the record.
Tested in Autocad 2012
Is this expected outcome, correct?
Henrique
The result you had gotten I get when I either A) Insert through the ribbon, or B) insert by typing "Insert" through the command line. That is what I'm looking for.
However I wish to make buttons for these two blocks. Therefore I need a macro, and with my macros, or through typing "-Insert" into the command line I come out with the placement above. Notice that in each block one of the annotative attributes places correctly, and one moves to a point relative to the origin.
I am unsure as to why.
When you do use those macros do you achieve what you had shown in your picture?
I tried using that macro you had shown me for the two commands.
[ELE]^C^C_.-LAYER;SET;"ELEVATION";;_.-INSERT;"ELEVATION - MODEL";SCALE;1;ROTATE;0;
[STATI]^C^C_.-LAYER;SET;"STATION";;_.-INSERT;"STATION - MODEL";SCALE;1;ROTATE;0;
However I get the same result shown below.
@ryled wrote:
When you do use those macros do you achieve what you had shown in your picture?
Yes, the picture i had shown was made from blocks inserted with those macros, I did try in AutoCAD 2010/12/14, and always successfully.
I can't understand what is causing that behavior...
Hopefully, someone else can reproduce that behavior.
Henrique
Maybe I have a system variable set different from what you do? I'll look into that. Thanks for your help Henrique, I appreciate it!
Try using
(command "-insert" ..........)
for your macro, i.e. a lisp driven macro rather than the python or whatever std macros are.
Assuming you're using a full version of cad this should work just as well, being as you're having issues- perhaps even better.
bhull1985
For my macro I did use "-insert" (see below). Unless you are referring to something else?
C^C^C-LAYER;SET;"ELEVATION";;^C^C^C-INSERT;"ELEVATION - MODEL";\
I found a solution by adding an ATTSYNC to the end of the macro.
[ELEVATION MARKER]^C^C^C-LAYER;SET;"ELEVATION";;^C^C^C-INSERT;"ELEVATION - MODEL";scale;1;rotate;0;\;;^C^C^CATTSYNC;NAME;"ELEVATION - MODEL";
Same concept for the station.