Jump to content
CAD_Question

Looking for a Macro to Insert, Rotate and Trim.

Recommended Posts

CAD_Question

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

Share this post


Link to post
Share on other sites
steven-g

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.

Share this post


Link to post
Share on other sites
CAD_Question

I tried this, but there wasn't a prompt to trim?

Share this post


Link to post
Share on other sites
CAD_Question

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?

Share this post


Link to post
Share on other sites
steven-g

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

Share this post


Link to post
Share on other sites
steven-g

Where do you have the macro, I just run mine from a toolpalette

Share this post


Link to post
Share on other sites
CAD_Question
Posted (edited)

I run mine withing the CUI. Here is the command line.

 

 

 

 

image.png

Edited by CAD_Question

Share this post


Link to post
Share on other sites
steven-g

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.

Share this post


Link to post
Share on other sites
CAD_Question

That worked! Thanks for all the help on this!

Share this post


Link to post
Share on other sites
steven-g

Your welcome, sorry about the mix up.

Share this post


Link to post
Share on other sites
BIGAL
Posted (edited)

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

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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