I am new to writing LISP routines, I have two Blocks made with attributes and I want to write a LISP routine that will allow me to Insert one of the two different blocks... I want it to ask me which block I am going to use and then let the attributes take over... any help would be great!!
actually you do not need lisp to a complish such a task,
but in order to learn autolisp here is one example:
(setq blkName (getstring "\nBlock name: ")) ; get block name
(setq p0 (getpoint "\nBlock base point: ")) ; get insertion base point
(setvar "attdia" 1) ; force autocad to open attributes dialog box
(command "-insert" blkName p0 1 1 0)
be sure to restore attdia to 0 at the end
there are many way to do this.
wrote in message news:firstname.lastname@example.org...
I am new to writing LISP routines, I have two Blocks made with attributes
and I want to write a LISP routine that will allow me to Insert one of the
two different blocks... I want it to ask me which block I am going to use
and then let the attributes take over... any help would be great!!
Note (Downside to this method):
If you edit the attributed block, the order of the attributes requested for filling out might change.
This includes moving the tag to another location within the block, or further formatting the tag (color, etc...).
Upside to this method:
No Idiot Mouse Box to pop up and fill out as this method already has the known information to add to the attributed block.
Scot-65 Dyslexia is a permanent physical disability that cannot be seen.
So if the names of my files blocks were "Quote 1" and "Quote 2" where would I place the names? Where does the code ask which one to open??
Sorry... But I almost know nothing about writing LISP routines!!
[Sorry... But I almost know nothing about writing LISP routines!!]
If you are running commands inside LISP, test the command on the command line first. Mimic the action you entered to the LISP.
An enter is a double quote "". A stop for user input (pic point or text) to be entered is "pause", without the quotes.
In script the enter is a semi-colon ";" or a space. Stop for user input is a backslash "\".
Depending on what AutoCAD version you are using, you may need to turn on the command line to develop your programs, and see what your results are, if any, from running the programs.
Say you have an elbow fitting. You use the same attributed block to define the size of each end of this elbow. This can be done in script using the insert command followed by the attributed values for each possible combinations of sizes. No longer do you need to fill out the values each time you insert this block, it becomes automatic. Now is time to look into the pull-down, Screen Menu, and toolbar areas. I am not knowledgeable enough to know if design center can do this...
ok... So heres the deal, I have two different blocks... I want the user to type in "Quote" in the command line and have a lisp routine to start up... I want it to start out by asking SilverScreen or SilverTape... when the user types in SS or ST it will then insert the appropriate block... SSquoteform and Stquoteform are the names of the blocks... is there any way someone can make this for me? I think it would be really simple to make I just have no clue about codes!!