Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insert Title Block and Scale

8 REPLIES 8
Reply
Message 1 of 9
emil.muresan
469 Views, 8 Replies

Insert Title Block and Scale

I want to add a macro to a toolbar button to insert a title block on layer 1B, with the insertion point (0,0,0), scale it to dimscale and zoom extents.
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: emil.muresan

Something like this should do it:

[ButtonTitle]^C^C-Layer S 1B ;-Insert TitleBlockName 0,0 (getvar "Dimscale")
;;Zoom E

There's lots more you could think about including, like setting the Layer
back to what it was before, or to Layer 0 or something, Osnap controls,
allowances for Attributes if it has them, and so on.

--
Kent Cooper


wrote...
I want to add a macro to a toolbar button to insert a title block on layer
1B, with the insertion point (0,0,0), scale it to dimscale and zoom extents.
Message 3 of 9
Anonymous
in reply to: emil.muresan

Whoops - came across with a line break I didn't give it. Put that all in
one line, with a space or ; after the ), or else put a + at the end of any
line(s) that isn't/aren't the last one.

--
Kent Cooper


"Kent Cooper" wrote...
Something like this should do it:

[ButtonTitle]^C^C-Layer S 1B ;-Insert TitleBlockName 0,0 (getvar "Dimscale")
;;Zoom E

There's lots more you could think about including, like setting the Layer
back to what it was before, or to Layer 0 or something, Osnap controls,
allowances for Attributes if it has them, and so on.

--
Kent Cooper


wrote...
I want to add a macro to a toolbar button to insert a title block on layer
1B, with the insertion point (0,0,0), scale it to dimscale and zoom extents.
Message 4 of 9
emil.muresan
in reply to: emil.muresan

Thanks Kent, it worked!

I want to create another one to insert a block on a specific layer 1N, based on dimscale, prompt for insertion location, skip rotation input and skip the prompts for 9 attributes that the block has.
Message 5 of 9
Anonymous
in reply to: emil.muresan

I don't struggle with attributes, so I'm not sure about the bypassing of
those prompts, but something like:

[ButtonTitle]^C^C-Layer S 1N ;-Insert +
BlockName \(getvar "Dimscale") ;;+


The backslash is the macro pause for user input for the insertion point.
The Insert command will provide its own prompt, but if you want it to say
something different, you can add a (prompt) function.

Again, you can have it save the current layer first and reset it afterwards,
and other stuff, if you want.

--
Kent Cooper


wrote in...
Thanks Kent, it worked!

I want to create another one to insert a block on a specific layer 1N, based
on dimscale, prompt for insertion location, skip rotation input and skip the
prompts for 9 attributes that the block has.
Message 6 of 9
emil.muresan
in reply to: emil.muresan

Thanks again!

I've added 9 semicolons to bypass the attributes prompts.
It works now.
Message 7 of 9
Tom Smith
in reply to: emil.muresan

Why not set ATTREQ to 0?
Message 8 of 9
Anonymous
in reply to: emil.muresan

As I said, I don't fight with attributes, so I don't know the possibilities.
Those who do can certainly advise better than I about such things, like
this.
--
Kent Cooper


wrote...
Why not set ATTREQ to 0?
Message 9 of 9
Tom Smith
in reply to: emil.muresan

Sorry I didn't see the post in time to suggest it sooner.

Turning off ATTREQ will mean you don't get prompted for attributes. You could save iits setting and restore it at the end of the macro so the user's normal preference isn't lost. To me that seems a better and more general solution than the multiple returns matching the number of attribute prompts.

Whether you want to be prompted for attributes at the time of insertion is a preference item, in my opinion. Even with the same block, sometimes I want this and sometimes I don't. So I usually try to have any atttribute-block-insertion routines end with the insertion and not address the attributes at all. That way, the user can set ATTREQ the way they want it.

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

Post to forums  

”Boost