Jump to content

Looking for a Macro to Insert, Rotate and Trim.


CAD_Question

Recommended Posts

HI Everyone,

 

I'm currently making a library of custom blocks that will be inserted into a custom toolbar. I have tried to create a macro to insert, rotate and trim around the block, but am having trouble with the trim portion of the command. if someone could edit the macro below to allow for the trim command to work it would be greatly appreciated. 

 

^C^C_insert;"Flanged Swing Check Valve";\;;;Rotate;last;;

Link to comment
Share on other sites

You have one too many semi-colons after inserting the block, does this work for you?

^C^C_insert;"Flanged Swing Check Valve";\;;Rotate;last;;\\Trim;last;;

This should finish with the prompt to select objects to trim and let you start picking objects. Why not use the Rotation option when you are inserting the block (unless the rotattion isn't based at the insert point)? that would just save a bit of code.

Link to comment
Share on other sites

It seems like the old macro is still linked to the block somehow? I went to the long string editor and changed the macro to insert and trim only (just to test the macro) and it will insert the block, then prompt for a rotation at the insertion point and finally end the macro. Any thoughts on when might be going wrong?

Link to comment
Share on other sites

You should be seeing this, depending on whether you use dynamic input or just the command line, if not then can you post a screenshot of what you see on the command line.

trim.jpg

Link to comment
Share on other sites

Looks like your system may well require that extra semi-colon during the insert part, try adding that back in. 💡 I created a test block and have it set to use uniform scaling which is probably why I don't need 3 semi-colons.

Link to comment
Share on other sites

You can use lisp in macros so it could be rewritten, it makes the number of ; and \ etc a bit clearer to follow.

 

The other thing to look at is the block default settings looking at 2020 its slightly different now depending on what is ticked on a insert can be name and pt only. This is probably why Steven-g had 1 less ;

 

Actually got down to block name only. Block inserted at 0,0,0 scale 1 1 1 rotation 0.

 

 

Edited by BIGAL
Link to comment
Share on other sites

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...