AutoCAD Visual LISP / AutoLISP :: Recording Macro Or Series Of Operations In 2007

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Create Materials In 2007 - 2008

Jul 17, 2007

In AutoCAD 2006 and previous versions when we had to create a new STANDARD material with a pattern/texture map and attach it to a selection set of objects, first of all we had to load render.arx (arxload “render.arx”) and then we had to call the following function:

;;; matname = New Material Name
;;; ss = Selection Set of Objects
;;; Matfile = The name of the jpg file
(defun SetMaterial (matname ss matfile / r1)
(if (null (member matname (c:rmat "l")))
(if (findfile matfile)

[code]....

The above function checks if a material with name matname exists and if not then it creates a new STANDARD material with name matname, material color (-1.0 -1.0 -1.0), which means derive the color from an object’s ACI (diffuse color), color-weight factor 0 (the amount of diffuse color) and a pattern/texture which is described in the list (list matfile 1.0 1 nil nil nil 1 1). The following table describes the pattern/texture arguments:

matfile name of the bitmap file
1.0 amount of map color to use
1 tile(repeat the patterns)
nil u and v scale factors (AutoCAD used the default values)
nil U and V offsets (AutoCAD used the default values)
nil (reserved by Autodesk)

[code]....

It was not necessary to define CreateNewMaterial with all these arguments, but I do it for future purposes.

In the attached file you can see the definition of MaterialExists, CreateNewMaterial and some other functions:

MaterialExists: Checks if a material exists.

DefaultNewMaterial: Default values for new materials. I have used the AutoCAD defaults, but one can modify them accordingly.

CreateNewMaterial: Creates a new material. If one needs more information on the meaning of the arguments I think Ralph Grabowski’s “Tailoring AutoCAD Rendering” is a good start.

AttachMaterialToEntity:Attaches material to objects

MaterialByLayer: Modifies an object to have material by layer.

AttachMaterialToLayer: Attaches material to a layer.

As you can see I don’t use vlax functions, because I write the code for OEM programming purposes. You can change the functions accordingly.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Of The Alt Key In A Macro

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

AutoCAD Visual LISP / AutoLISP :: Macro In MNL File

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

AutoCAD Visual LISP / AutoLISP :: Select All In Macro

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

AutoCAD Visual LISP / AutoLISP :: Macro - Auto Numbering

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

AutoCAD Visual LISP / AutoLISP :: Execute Macro In CUI Menu

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

AutoCAD Visual LISP / AutoLISP :: How To Use Civil Menu Macro

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

AutoCAD Visual LISP / AutoLISP :: Call Excel Macro

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

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 View Related

AutoCAD Visual LISP / AutoLISP :: Macro Block Inserts And Layers

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

AutoCAD Visual LISP / AutoLISP :: Excel Macro To Zoom To Object In Current DWG?

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

AutoCAD Visual LISP / AutoLISP :: Save Additional Copy Of DWG File Using Macro

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

AutoCAD Visual LISP / AutoLISP :: Copy And Rotate Macro Not Working In 2013

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

AutoCAD Visual LISP / AutoLISP :: Tool Palette Macro To Insert Explode Block

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

AutoCAD Visual LISP / AutoLISP :: Running Code As Macro (custom Command In Ribbon)

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

AutoCAD Visual LISP / AutoLISP :: Write A Macro In CUI That Opens A Drawing In Read-Only Mode?

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

AutoCAD Visual LISP / AutoLISP :: Macro To Open Third Party Program From Toolbar Button

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

AutoCAD Visual LISP / AutoLISP :: Conversion Of Base Routines To Diesel MACRO Based Routine

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

AutoCAD Visual LISP / AutoLISP :: Using Macro Parameter Contains Space (changing Layer Color From Command Line)

Sep 19, 2013

I'd like to change a layer's color from command line because of a user icon. I figured out from previous topics that I should use macro similar to this: ^C^C_filedia;0;-la;s;Verdeckt (ISO);c;1;l;dashed;;_filedia;1;re;

(I want to use this macro to change layer's linetype, too, but that's not the point)

The only problem with this macro: layer's name contains a space therefore Autocad tries to recognize Verdeckt as a command (and macro interrupts there) instead of setting Verdeckt (ISO) as the current layer. I've tried using different quote marks, none of them worked (' and " and <>). I hope there's a method for entering a parameter that contains space.

Software: Inventor Series 2011 SP1 x64
OS: Vista Business x64
CPU: E6400
RAM: 2*2Gb GeIL
VGA: Quadro FX 550

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Continuous Dimension Lisp That Alternate Its Position

Jul 12, 2012

Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high?  If there is no lisp already created, how to create one? 

See Continuous dimension attachment for example.

I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

Nov 14, 2013

I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg").  how would i go about doing that using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Opening Drawings With Default Visual Style Set To 2D Wireframe

Oct 7, 2013

Is there a way to programatically set a visual style before a drawing actually opens?

We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings.  Some models will crash on some workstations when trying to open in a rendered mode.

I found a lisp with a function that looked to set viewport visual styles.  But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Visual Effect Settings?

Jun 20, 2013

Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combinations In DCL?

Sep 7, 2012

Is it possible to execute a certain command based on multiple selections withinin a dcl?  for example:  two radio colums, one with selections A and B, and a second with selections 1 and 2.  is it possible to program commands based on user selections from each column?  ex: if A and 1- do a command.  A 2- do a different command, etc...

I tried :

 (action_tile "key1" "(setq A t")
 (action_tile "key2" "(setq B t")

 (action_tile "key3" "(setq 1 t)(done_dialog)")
 (action_tile "key4" "(setq 2 t)(done_dialog)")

(if
(and (a) (1)
)
(command ...

but was unsuccessful.  no matter which combination was selected, the command under all combinations would run.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Attribute Value

Jun 3, 2013

I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 3D Point From X And Y?

Oct 9, 2013

I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).

Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me: 

node
of #<variant 8197 ...>

Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Point At Each End Of Arc?

Dec 19, 2011

What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
 
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn

[Code].....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get The Value Of Attribute

Dec 30, 2011

Is there a quick way of getting the value of an attribute?

I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".

I just want to be able to quickly grab that value.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved