AutoCAD Mechanical Forum
Welcome to Autodesk’s AutoCAD Mechanical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Mechanical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Icon Commands

2 REPLIES 2
Reply
Message 1 of 3
david.penney00
589 Views, 2 Replies

Custom Icon Commands

Hi,

 

Been so long since I did this I can’t for the life remember what I did previously!

 

Maybe someone has a better memory  Man LOL

 

I want to add two custom icons to my AutoCAD 2014 desktop.

 

So clicking on…..

 

Icon 1:

T2   - This would give me the option to set a Mtext box for size 2.5 mm text on standard (already existing) layer AM-TXT-25

 

Icon 2:

T3   - This would give me the option to set a Mtext box for size 3.5 mm text on (standard already existing) layer AM-TXT-35

 

Note: Textstyle has already been set in the drawing template as ISOCPEUR

 

I did a bit of reading, but what I have found is usually relating just to a command…..etc.

 

Any suggestions or help with this problem would be appreciated.

 

DP

 

2 REPLIES 2
Message 2 of 3

Hi 

 

Please follow below steps to create a custom command;

 

1. command: Cui

2. New command under command controls

3. Name the command and enter the macro as shown in the attached image

4. Drag the command under any toolbar or new toolbar

5. Click OK

 

The macro will first set a layer current, followed by a text style with required height and will call the Mtext command.

 

custom_command.png

 

I see a drawback in the macro where you can't see the mtext frame while adding text.

 

Thanks,

 

Please select the Accept as Solution button if my post solves your issue or answers your question.



Sridhar Subramani

Senior Product Owner

Message 3 of 3

Many Thanks for that.

However, I came across a lisp file I have tweaked and tried to use attached to the icon command.

 

It works great for the T2 MText - with correct size, layer, textstyle and even the MText box prior to typing.

 

But on using an edited copy of this working lisp to suit the T3 text, with the only changes being layer and text size, etc.....it won't work!  For some reason, it still uses the T2 parameters!

 

Current Default Style settings:

Command: -STYLE
Enter name of text style or [?] <AM-STANDARD>:

Existing style. Full font name = ISOCPEUR
Specify full font name or font filename (TTF or SHX) <isocpeur.ttf>:
Specify height of text or [Annotative] <0.00000>:
Specify width factor <1.00000>:

Specify obliquing angle <0.00000>:
Display text backwards? [Yes/No] <No>:
Display text upside-down? [Yes/No] <No>:

 

Check out the following comparison (and attached screenshot) of the file top lines. all the rest is identical:

Summary for 1 <--> 2: 51 Line(s) match 3 Block(s) diff 4 : 4 Line(s) diff

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost