Inserting a block with a macro

Inserting a block with a macro

Anonymous
Not applicable
1,990 Views
3 Replies
Message 1 of 4

Inserting a block with a macro

Anonymous
Not applicable

Need some help with a macro. Im trying to insert a specific block with a macro then run attsync directly afterwards with the same block.  i want to overwrite the block thats in the drawing then update the attribute. I cant seem to get the macro to redefine the block. Here is my macro.

 

^C^C-INSERT;"H:/BL-LIB/Sheet Info 24x36.dwg";0,0;;;;attsync;Name;Sheet Info 24x36;

0 Likes
Accepted solutions (1)
1,991 Views
3 Replies
Replies (3)
Message 2 of 4

tcorey
Mentor
Mentor

Post your drawing, SheetInfo 24x36.dwg, and we'll test it for you.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
Message 3 of 4

steven-g
Mentor
Mentor
Accepted solution

You need to show that you are wanting to redefine the block by using the format "blockname=new file" and give the answer "yes" to wanting to redefine the block, at the moment your macro is just inserting another block with the same name as an existing block so the exsisting block definition will be used.

Try this but it might need tweeking, and if you put the block into Autocads search path then you won't need the complete file path.

 

^C^C-INSERT;"Sheet Info 24x36.dwg=H:/BL-LIB/Sheet Info 24x36.dwg";y;0,0;;;;attsync;Name;Sheet Info 24x36;

Message 4 of 4

Anonymous
Not applicable

@steven-g wrote:

You need to show that you are wanting to redefine the block by using the format "blockname=new file" and give the answer "yes" to wanting to redefine the block, at the moment your macro is just inserting another block with the same name as an existing block so the exsisting block definition will be used.

Try this but it might need tweeking, and if you put the block into Autocads search path then you won't need the complete file path.

 

^C^C-INSERT;"Sheet Info 24x36.dwg=H:/BL-LIB/Sheet Info 24x36.dwg";y;0,0;;;;attsync;Name;Sheet Info 24x36;


Thanks,

I did have to reconfigure this a bit but it's working now. I had to take off the .dwg on the "blockname=new file" because it was inserting the block & renaming to "blockname.dwg" which i did not even know was possible. Here is what i ended up with:

 

^C^C-INSERT;"Sheet Info 24x36=H:/BL-LIB/Sheet Info 24x36.dwg";y;;0,0;;attsync;Name;Sheet Info 24x36;

0 Likes