AutoCAD Visual LISP / AutoLISP :: Combined Commands In One Macro Button?
Jun 28, 2012
I am trying to create a short cut button with a macor code.
I want it to set up a new orgin and set a base point in xrefs i am creating
The commands i want to combined are the follwoing
UCS enter
3P enter
BASE enter
The macro i am using is the following
^c^c_ucs 3p \_base
but it wont run the base command after it finishes the 3P command
This is whats show up in my commands bar
Command: _ucs
Current ucs name: *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]
<World>: 3p
[Code]....
View 4 Replies
ADVERTISEMENT
Feb 7, 2012
I'm trying to create a macro for a toolbar button to open a third party program. Basically we want to open a custom .exe application from a button on the ACAD toolbar.
View 5 Replies
View Related
Nov 7, 2012
I've been testing out a few lisps just now, trying to get to the one I want.Somewhere along the line something has changed a setting in the program and I don't know what or how to get it back.
Similar to the PICKFIRST sysvar, but not that. (PICKFIRST is set to 1).
When I select objects and issue a command like move or copy, all is fine.
When I select objects and hit Ctrl+C, the selection set is ignored and I am prompted to select objects.
When I double click on text to edit, the ddedit or mtedit command is issued at commandline, and I am prompted to select an object.
View 2 Replies
View Related
May 29, 2013
I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing.
I believe I need to insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?
View 1 Replies
View Related
Mar 19, 2012
Any way to override existing AutoCAD commands.
Lets try this. When a user types "line" at the command prompt, or hits the "line" button on the toolbar, or chooses "line" from the draw pulldown menu, is there any way I can re-write what line means and draw a circle? (Extreme example)
There are just some commands that I'd like to have a variable set in the background, depending on what the command is. So I'm thinking if I could re-write the "line" command, instead of trying to convince everyone to use and remember a custom command, it would be much more efficient. There are lisp files already loaded in their start-up suite. Not sure if that works.
View 4 Replies
View Related
Dec 18, 2012
I just started learning LISP yesterday, as our office needs an autosave LISP. People have requested it and I have to do it...
How I wanted to do it:
The LISP will be loaded on every PC of every person with AutoCAD.
On startup "command_count" will be on 0
When using a command like plinie this happens: (+ 1 command_count)
Commands like zoom, undo etc will be ignored
When command_count reaches 20 it executes the qsave command
If using the qsave command it resets the command_count to 0
Thats my not working LISP atm:
(defun c:losave ()(setq command_count 0)(+ 1 command_count)(if command_count 10 "_qsave"));(if command "_qsave" setq 0);(if command "_zoom" (- 2 command_count));(if command "_undo" (- 2 command_count));(if command "_qsave" (* 0 command_count));(setq command_count (+ 1 command_count))
View 9 Replies
View Related
Aug 27, 2013
I used to have a short, one-line macro in my MNL file that would read the location of the currently active drawing, find the parent directory of that drawing (truncated to 3 levels) and open a Word document in that directory that is named after the project.
For example, if the active drawing path is
"Q:/Projects/12345 Cold Storage/Elevations/Phase 1/North Storage.dwg"
this macro would open the Word document named
"12345 Cold Storage.doc"
that was in the directory
"Q:/Projects/12345 Cold Storage"
If the file did not exist, it would be created named the same as the 3rd level directory.
After i wrote this, it sure sounds like a lot, but as i remember, it was a short, one-liner. Of course if a lisp routine would be better, that's okay too. I understand beggars can't be choosy.
View 9 Replies
View Related
Jun 19, 2013
Trying to add this macro to a new command in my cui. Does Select all not work in macros?
^C^Clayiso;;_select;all;;_chprop;la;c-rway-x;;
View 8 Replies
View Related
Jun 29, 2013
My first lisp, so bring it hard on me I want to be an expert in autolisp .
My lisp is meant to do the following:
draw a rectangle with ”0” fillet. It can be done either via rectangle command, or pline command. The attached lisp has the variant with the pline-case.
The, I need to draw inside a smaller rectangle, with a fillet value, that is promoted and indicated by the user. The smaller rectangle must be centered inside the bigger one. I thought it was a good idea, to take one insertion-point for the bigger rectangle.
and to calculate a 2-nd insertion-point for the smaller rectangle, via "polar" function.
What I get:
the 2-nd insertion point is put the same as the 1-st one.
I wish to draw the bigger rectangle with one layer "example: Layer 1", and the smaller rectangle with another layer "example: Layer 2".
View 9 Replies
View Related
Feb 10, 2009
Im using AutoCAD 09 for the first time and need to find out how to customise my snap commands to F keys. I've been using 2004 and it was really easy. 09 seems to not allow it?
for example i set F4 to end point and F5 to intersection point etc. it saves using O snap or a tab. just L, F4 and its done (for example)
View 4 Replies
View Related
Aug 6, 2012
I urgently need a program that can auto number panels for a large drawing I have. I have a lisp program for auto numbering but we need each insertion of text to start with a P i.e. P1, P2, P3 etc etc.
View 2 Replies
View Related
Oct 30, 2013
I have tried to find information about this, but I am having a hard time. So i need to explain what I am doing.
I would like to be able to use commands stored in the cui menu file, initially this is done using our tablets, but our tablet drivers cannot work with windows 7 and autocad, nor can i get any that do, (i have tried over 20 different drivers).
So, instead of making a lisp function for every macro. I need to be able to use some of them.
Can I execute one of these macros using "MENUCMD" ? , I have all the information i need to do it but cannot figure it out menucmd does not seem to have an option to actually run the macro, and if it does It only seems to be able to do that with popup menus.
Currently i use the ribbon and add them in there, but want to know If i can do so just with lisp. and create my own on-screen tablet menu.
Here is an example of one of the macro's in the cui i need to use.
And here it is in the cui menufile:
UNDER-> <MacroGroup Name="User">
<MenuMacro UID="MMU_WT1[A-5]">
<Macro type="Any">
<Revision MajorVersion="17" MinorVersion="1" UserVersion="1" />
<ModifiedRev MajorVersion="17" MinorVersion="2" UserVersion="1" />
<Name xlate="true" UID="XLS_6804">WT1[A-5]</Name>
<Command>^C^CDTEXT C .125 0 </Command>
</Macro>
So.. that is my question how can i use that command via lisp..
View 9 Replies
View Related
Oct 7, 2011
I would like to use the following macro from the LDD 2004 Civil menu (yes, we are still using 2004!): ^C^C^C^P(cd_mnl)(zz_sdsk '(ad_xsutl 2));LDD. The macro is Zoom to Station from the Cross Section pulldown menu. How to use this in a LISP routine, or an equivalent LISP command? (The user won't be supplying the station number. The station number will be extracted from a selection set of objects with attribute blocks with equivalent station numbers.)
Each cross section has an attribute block associated with it, which lists all the details for that section, including station. The macro must be using that block (listed in a database, perhaps?) to find the station in the dwg.
View 4 Replies
View Related
Nov 10, 2012
i want to call an excel macro from a lisp. is it possible?
now i have this:
(startapp "C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
(strcat """
(getvar 'dwgprefix)
(vl-filename-base (getvar 'dwgname))
"XXX.xls""
)
)
i just want it to run macro1 from book1.xls
View 2 Replies
View Related
Sep 12, 2013
i like to work with block system in my project , but i dont like to use block editor or refedit for every action inside my block ...i found some lisps for add or remove objects from blocks but not enough for dont use to block editors , i need to lisp for use ordinary command for blocks without get them inside if ther is possibility ...
View 1 Replies
View Related
Nov 15, 2013
I have a simple lisp function to add a scale axis to a drawing by calling a script, renamed the drawing by appending "withScale" to the file name, and then closing the file. I placed a call to the function in the acad.lsp file in the startup suite. The idea was to batch process all files by simply opening them. Upon open the startup acad.lsp file runs, which calls my lisp function, which in turn calls the scale script. It should then execute the renaming, saving, and closing commands. The problem is that it is calling the script fine and renaming the file, but it does not save the changes before closing. Here is the lisp function
(defun saveScale(); (command "-purge" "all" "" "n")(if (findfile "C:/Users/Russell/Desktop/TreeFiles/Automation/Scale&Key.scr")(command "_script" "C:/Users/Russell/Desktop/TreeFiles/Automation/Scale&Key.scr")); end if (command "_.zoom" "e") (command "_saveas" "2013" (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "withScale.dwg")) (command "close") ) (saveScale)
Apparently you cannont run any lisp commands after calling a script, however the renaming still follows through.
I've attached the script file as well. (I couldn't attach .scr format so you may need to rename it).
View 9 Replies
View Related
Jul 10, 2013
Im currently creating a custom menu to insert blocks on request. I have set up the following macro which seems to work fine:-
^c^c-insert;HVLV-UB610x125;;;;
However when pulling in a specific block the drawing the layer becomes 0.
Ive tryed adding this additional macro line before the above one which fixes the problem :-
^C^C-LAYER;M;E-LIGHTING-CEIL;C;R;;;ORTHOMODE;1;^c^c-insert;HVLV-UB610x125;;;;
However now the block retains its layer properties ......ie E-Lighting-Ceil (or what ever I name it) but it drops the block
in RED, instead of its original colour.
Question is Im looking for a macro that will bring in my block as per ^c^c-insert;HVLV-UB610x125;;;;
but also bring it in to a drawing on its original layer that its saved to.
please note that even thou the first code brings it in at layer 0, the blocks layer is also inserted into the DWG however its just not associated to it ..... hence the user has to select the block once he or she has brought it in and then change the layer from the layers manager manually. This is not ideal.
just to recap i just need a macro that will A) bring in a block from a location. And B) keep all the properties it has when it is brought in.
View 3 Replies
View Related
Jul 19, 2013
I can run the ACC fine on multiple DWG files with a basic set of commands in the script file. But, when I try to load an AutoLISP/Visual LISP file and run it from inside the script file, it doesn't work. How to run a LISP file using the ACC?
View 1 Replies
View Related
Oct 17, 2013
I'm able to add custom panels/buttons into the Ribbons, by cloning the existing ribbon (from acade.cuix) into my partial cuix. However.. I'm not able to add more commands to the shortcut menus, using the same technique.
Is it possible to add custom commands to existing shortcut menus using a partial cuix?
View 3 Replies
View Related
Jun 14, 2013
I am looking for an example excel macro to zoom to an object given the obect entities handle.
View 2 Replies
View Related
Aug 11, 2012
I need to save an additional copy of a AutoCAD drawing whenever I press the save button.
Simply put, Every time I press save the autocad drawing is saved (Obviously!!!) but
I also need to save an exact copy of the drawing in a folder called (for eample only) "C:TestFolder"
I can do this using DxfOut for dxf files but I need to do this for dwg files.
Can it be done whenever I press the "save" button.
View 1 Replies
View Related
Oct 19, 2012
Any easy way to create a macro or record a series of commands in 2007? It's my understanding that 2009 has this feature "built in".
I want to "record" a short series of commands/actions to use as a example to other novice users at my company.
It should be something that they can "run" and watch on their screen. (like trim a circle to get a arc)
I have downloaded/tried several general screen recorders but the resulting file is way too big. (20MB AVI)
I would prefer a Macro that would run right in Autocad. Maybe a third party plugin is available?
I am not looking to create a traditional Macro to use as a time saving device.
View 1 Replies
View Related
Apr 29, 2012
I have a macro that i have been using in autocad 2012 for a simple copy & rotate command as follows
^C^C_select;auto;\_copy;p;;0,0;0,0;_move;p;;\_rotate;p;;\redraw
For some reason it now does not work in 2013 the macro exits after the copy part of the macro is finished & fails to let you rotate the copied object.
View 5 Replies
View Related
Feb 15, 2012
I would like to creat a dialog box with buttons or radio buttons to insert various blocks. something easy to start the dialogue, push the button desired and my block or lisp is inserted or run. I have the dcl part figured out. i'm not quite smart enough to get the lisp down. is there a generic lisp that can reference a lisp command that i can alter or edit and add to?
View 4 Replies
View Related
Mar 29, 2013
It's been too long since I created one of these for Toolbars. I need a macro that will insert and explode a block. I just need the block's content, not the block itself. I can create a maco to explode a block with no path, but can't remember how to include the "*" in a file with a folder path to explode the block while its being inserted. Because of spaces in the file name, quotes (") must be around the path.
View 1 Replies
View Related
Dec 23, 2011
So I can run the following code from the command line with no problem:
(WRK-Insert_Standards_Block '("S:\AUTOCAD\_Common\Linetypes\CSW_Civil-Linetype"))
(WRK-Insert_Standards_Block '("S:\AUTOCAD\_Common\Linetypes\CSW_Survey-Linetype"))
(WRK-Layer_Insert_all "CSW-X-FM_Layers_List")
However when I put it into a macro (custom command to be used from the ribbon) it spits out the following in my command line:
(WRK-Insert_Standards_Block '("S:
View 2 Replies
View Related
Sep 18, 2012
Is it possible to write a Macro in the CUI that opens a drawing in Read-Only mode? Limitation : AutoCAD LT.
View 7 Replies
View Related
Aug 23, 2011
What the require setting to enable me to lock of several layer continuously when i click the "LAYER OFF" button at the toolbar? I wish to set to be like whenever i use the "LAYER OFF" command, i can direct just continue to click several layers for it to be turn off.
View 9 Replies
View Related
Jul 3, 2012
" Convertion of AUTOLISP base routines to Diesel MACRO based routine to be used in a AUTOCAD LT based platform "
Here i am attaching the lisp file for ready reference.
View 1 Replies
View Related
Feb 18, 2013
How to add buttons and create my own ribbon in AutoCAD, but now I would like to be able to have buttons for two different schedules that I have created. While I can have a button start the schedule command it won't automatically pick the schedule that I want it to create.
View 1 Replies
View Related
Jun 28, 2013
I am trying to revise an old dialog box so that I can add some new options but I'm finding it difficult to shorten the label for a radio button enough to get the box width to look reasonable. I read somewhere that Windows fonts cause the label lengths to hold extra space for each character. The webpage that I found this on said the solution was to make a new line for the label, which sounded great to me, but they did not tell how to do it. After much searching, I figured out how to add an additional line to the label, but my program now refuses to function correctly. I set the middle button before initiating the dialog in my lisp, but when I select a different option, the original button remains selected along with the user's choice. The program actually works, using the last button selected, but I really want the button to respect the pick by the user and deselect the default button.
This worked perfectly when I had only two selections, and it still worked perfectly when I added the third option, but it just doesn't like it when I try to add a new line for the long description in the middle of a radio column.
I'm barely functional with dialog boxes..
DCL in question:
:boxed_radio_column { label = "Location"; width = 20; height = 2; fixed_width = true; fixed_height = true; alignment = top; :radio_button{key = "sl-AD"; label = "Spring Lake Applications";} :text_part{label = " and Distributor Services";} :radio_button{key = "sl-BP"; label = "Spring Lake BP Systems";} :radio_button{key = "gr"; label = "Grand Rapids";} }
lisp has the following in this order:
load dialog - I have a loading function that works fine
(set_tile"sl-BP""1")
(action_tile"sl-AD" "(TGW-Setup_01 $key)")
(action_tile"sl-BP" "(TGW-Setup_01 $key)")
[Code] .....
Of course, these are just the pertinent sections of a much larger setup dialog, but I didn't think I needed to post all the functions that this program is doing, since you'd have a difficult time running this without my templates, printers and a number of support files.
Like I said, it seems to be choking on my adding :text_part { Label = " and Distributor Services";} instead of making this a single line of the label for the button above it.
Why does this cause the default radio button to stop releasing?
View 3 Replies
View Related