CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closedinsert block command

 Post Reply Post Reply
Author
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Topic: insert block command
    Posted: 25.Sep.2014 at 17:36
Hi, I'm trying to create an icon for my ribbon that I will be able to click and it will insert a certain block. I think that I need to create a command that will get the block that I need and insert it where I need it to go as for an example, I have created a block for a pipe going down. I would like to click the icon and to place the elbow of this pipe to show a pipe going down on plan.

thank you in advance for the help.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 25.Sep.2014 at 17:54
It could be accomplish with a macro that invokes the INSERT command.  The macro would include the path to and name of the block. 

Will you be entering the same block multiple times in succession?

Will you be changing the X scale factor?

Will you be changing the Y scale factor?

Will you be changing the angle of rotation?


Edited by John Connor - 25.Sep.2014 at 18:06
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Posted: 25.Sep.2014 at 18:14
I would like to click the icon to insert 1 block, so if I need to insert 2 or 3 I would need to click every time I need that specific block. for the x and y factor I would like it to scale together, so that if I scale to 100, they will both scale to 100 but I think I can fix that directly in the block. and for the rotation I would like set it every time I insert the block.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 25.Sep.2014 at 18:29
The macro could be made to be self-repeating.

The default is if the X scale factor is changed then AutoCAD assumes the Y scale factor will be changed to the same value.

Rotation could be changed upon insertion too.

Your macro might look similar to this....

*^C^C-INSERT;yourblockname;\;;;
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Posted: 25.Sep.2014 at 19:01
and for this to work, do I need to insert the block once in the drawing or do I need to put it in a certain folder of autodesk for it to find it. or do I need to mark the path of the block in this macro ? and thank you very much for your time and help.
Back to Top
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Posted: 25.Sep.2014 at 19:21
I have found the problem, I added the Block folder on the path options and the macro you gave me works like a charm! it inserts right away ! now is there a way to make me ask after I give it an insert point what scale I want ? I can set it in properties but it will make the command that much more perfect for me :)
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 25.Sep.2014 at 19:43
The < \ > symbol is a pause for user input whereas the < ; > symbol acts like a return (i.e. - hitting the Enter key).  I'm pretty sure that's correct.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 686
Direct Link To This Post Posted: 26.Sep.2014 at 15:33
Originally posted by decastro31 decastro31 wrote:

... is there a way to make me ask after I give it an insert point what scale I want ? I can set it in properties but it will make the command that much more perfect for me :)
 
The first backslash in that macro is the pause for the User to specify the insertion point.  The first semicolon after that is an Enter to accept the default X scale factor of 1.  If you just change that semicolon to a backslash, it will ask the User for the X scale factor, and will follow with Enters accepting the defaults for the Y scale factor and Rotation.
 
Alternatively, you can use the Scale option, which will apply the same factor in all axes, and since it is an option you use before the insertion point, it has the advantage that you get to drag the Block into position with it showing already scaled:
 
*^C^C-INSERT;yourblockname;S;\\;
 
The first backslash is for User input of the Scale factor, the second is for the insertion point, and the final semicolon is an Enter for the default Rotation of 0.  If you also want to specify the Rotation each time, and have it already rotated as well as scaled while you drag it into position, also use the Rotation option:
 
*^C^C-INSERT;yourblockname;S;\R;\\
 
In fact, you can shortcut that, and have it simply leave you in the command to finish up with the rotation and insertion, rather than having the pauses explicitly built into the macro for those:
 
*^C^C-INSERT;yourblockname;S;\R
Back to Top
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Posted: 26.Sep.2014 at 16:49
I have used *^C^C-INSERT;block name;S; so I click on my icon I decide on the scale then I click where I need the block then I rotate. exactly what I needed to do. this will cut the time of making my plans in half. I couldn't  of done without both of your help. thank you so much this makes my life a lot easier and I always love to learn new stuff :)

thank you again ! 
Back to Top
decastro31 View Drop Down
Newbie
Newbie


Joined: 14.Jan.2013
Location: Canada
Using: AutoCAD 2013
Status: Offline
Points: 7
Direct Link To This Post Posted: 26.Sep.2014 at 16:51
Now what is left to do is to find a way to create an image for those small icons :)
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,367 seconds.