Jump to content

Search the Community

Showing results for tags 'macro'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 47 results

  1. Hi everyone, I'm new to using macros/lisps in AutoCAD, though I do have a small programming background in some other programs. To give you some background on what I'm trying to do: I have a big .dwg file that shows all of the roads in a particular city in the USA, and I have created views of all of the intersections that have crosswalks. All of these intersections have their own intersection IDs, which have a format such as BRI1, BRI2A, BRI3B, BRI4, BRI5, etc. I have already created all of the views from these intersections (of which there are over 100), and now, in the same .dwg, I am trying to quickly create layouts from a template that show only one view each. I have a .dwt set up for this, and the name of the layout for this template is EB124. I am having no trouble creating these layouts individually, but as there are over 100 in this particular section of the city, I want to be able to quickly create the layouts and then move onto the next section. Here are the commands that I used to try to create a macro for this using the Action Recorder: -layout > t > [select template from file] > EB124 -layout > set > EB124 -layout > rename > EB124 > [ASK FOR USER INPUT] [select the viewport in the new layout and unlock the display] MSPACE -view > restore > [ASK FOR USER INPUT] PSPACE [select the viewport and lock the display] When I do these all while recording the macro, it works perfectly. However, when I try to play the resulting macro, it works like a charm until it seems like the macro doesn't actually execute the MSPACE command? So I am in paperspace when it executes the -view>restore portion, which then seems to delete the xref that contains the titleblock? I have tried using REA afterward in case the xref is just not showing up, but it looks like it is instead replaced by a polyline, which seems bizarre to me. I also tried executing the -view>restore command while in paperspace outside of the macro to try to replicate the problem, and it results in the same problem. I have attached screenshots of the action recorder commands (because I don't think I can attach the .actm file?) as well as screenshots of what correct results and actual results look like. Note that the views in the "correct" vs "incorrect" results are different, and this is OK. Unfortunately due to confidentiality, I cannot actually attach the .dwg file. I also figure that there is an easier way to do this using lisps, but I just don't even know where to start... Thanks in advance for any help!
  2. roldy

    Move a spline using a macro

    I am needing to copy and move a spline in a sketch without using the spline's ID. Within the macro code, I have defined the selected spline in the sketch to a SketchSegment variable. Any help would be great.
  3. Hi. Can someone please help me, tell me or explain to me how to create new layer with macro. I want define a new button which when I push it will make new layer and ask me for define name and colour of new layer. I'm kind a new to this. I found only this code using LISP. But I want macro for button. (defun c:SetLayer (/ name col) (if (setq name (getstring t "New layer name: ")) (if (tblsearch "LAYER" name) (progn (prompt "Layer already exists, set as current.") (setvar "CLayer" name)) (if (setq col (acad_colordlg 7 nil)) (progn (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(70 . 0) (cons 2 name) (cons 62 col))) (prompt "Layer created and set current.") (setvar "CLayer" name))))) (princ)) Thank you for your time guys and have a nice day
  4. Hi, I'm new to AutoCAD. I have 700 drawings in AutoCAD. I have to enter "Checker" value in the drawing title block. For all the drawings, its the same value. How to I automate this? I don't want to open manually individual drawing and fill the value. Any macro available for this? Please help. Regards, Prasanna.A
  5. Hey guys! I am working on a macro where the user will click the button, the macro opens a script to open a new drawing with a client template, after that it'll load a couple of lisps and run those to setup the standard layers and automate the drawing layout portion. I am fairly new to this, I have noticed that the macro quits as soon as the script runs opening a new drawing. Is this a limitation with running a macro?
  6. Hello.. Not familiar with autolisp or scripts I work for a earthworks company, and we are looking for a way to have an excel worksheet to update progress completion by coloring a property another colour in autocad. Example - lot 1 10% complete, and lot 10 is 30% complete as per excel data. I would like lot 1 (10%) to be light green and lot 10(30%) to be a darker green and darker shades for higher % completion and for the autocad drawing to update as the excel data sheet is updated. I have aproximatly 400 lots to program in this way if possible. Each lot will have 10 conditions (ie 10%, 20%, 30%... to 100%) Thank you
  7. I'm trying to write either a script or a macro to make it easier to do an array that we will need to replicate on a regular basis. Basically, I want a path array to offset mtext every 20m along a centreline. If I do this in the command line, it's fine: ARRAY select object PA [path] select path curve M [method] M [measure] I [item] 20 [distance apart] F [fill length of path] A [align to path] Y [confirm] X [exit] If I do this in a script or macro, I encounter a difficulty in that the type of array is limited to polar or rectangular. It doesn't even register that path is an option. If I try a similar thing using ARRAYPATH, the options that come up from the macro/script are totally different to the command line options. Am I missing something, or is CAD just unhelpful on this? Running LT, so can't do LISPs
  8. Hi, I am trying to get some advice on the best way to hatch multiply poly lines in any particular layer. I do not want to manually hatch each poly lines as there are dozens in multi files and was hoping to get some help with a simple script. I have attached an example of what I will be working with the layer I wish to hatch is 1129. Any help would be greatly appreciated. Cheers bend nb120.dwg
  9. ILoveMadoka

    Solidworks Macros - 2 Part Question

    1) Are there any SW API Power Users Here? That could help modify macro code? 2) Are there any sites that anyone can recommend similar to CADTUTOR specific to solidworks (More specifically Macro programming/editing) I find a lot of blogs but not a lot of interactive type sites.. I know there are some experienced SW users here but I am trying to learn more about Macro creation/modification. Here is an example: I have multiple details in a SW drawing that each have "Detail X" on one line and "Scale 1:2" on the second line. I have to make the "Detail" text one size, the "X" another size and the "Scale 1:2" text a third size. (Not my idea! ) I recorded a macro highlighting each text portion and changing the text size but when I run the macro on a new piece of text, it changes the entire text item to each size in turn. These labels are identical so it seems easy enough but not sure if a macro can do something of this nature in a single step. Any help, links, etc is greatly appreciated!!
  10. Hello, I'm a new user about autocad and new user about this Forum. I try use VB and CAD... Is there a solution for my problem in object? i just write code for MSGBOX: Dim Variabile As Integer Variabile = MsgBox("Hai esportato i parametri?", vbOKCancel) If Variabile = 2 Then ActiveWindow.Close and work if use a macro....but for insert this message when close a file? can i make a particular macro for this like excel or access??? thanks for You interest
  11. CyberAngel

    Alignment Geometry Editor Disabled

    This is not so much an issue as an addition to the knowledge base here. If someone has had this issue before, I couldn't find it. An associate here was trying to add a couple of PIs to an alignment. When he pulled up the geometry editor toolbar, most of the buttons were greyed out and none of them worked. Part of the troubleshooting SOP is restarting AutoCAD, during which he got a message about enabling macros. The first time he had answered No. This time he said Yes, and the geometry editor worked. So be warned. There are some commands in Civil 3D that depend on macros.
  12. Hi Is there a way to create a macro which would find the inertia of a region out the (0,0)? Currently, I have to Massprop the object, draw a line from (0,0) to the centre of the object, move the object from the end of the line to the centroid, and then massprop it again to get the correct Ixx and Iyy values. I have looked into creating a macro for it, but I don't know how to use the initial centre values to move the object to (0,0). Is there a way to do this via amacro? If not, is there any other method unknown to me to find the Iyy and Ixx values of an object as if it is sitting at (0,0)? Thanks in advance, hope this all makes sense.
  13. Hello everybody, I've created a macro for creating different dimension styles for different scales. We are using these dimension styles in our company. It works well if I use it in a new, empty drawing. But if I use it in an excisting drawing with a dimension style with the same name, I have got a problem..... I'll see this in the command line; "Enter name for new dimension style or [?]: "scale 20" That name is already in use, redefine it? :_dimclrd Invalid option keyword. That name is already in use, redefine it? :" "_dimclrd" should be the next command in the macro, but because "scale 20" is already in use, I need to do some other commands first. AutoCad stops with this macro at this point. If the first dimension style, which the macro should be create, already in use, the other dimension styles shall not be create. Is there a possibility/ sollution to change my macro so he creates every dimension style what he supposed to do? Also if one or more dimension styles already excist? The reason why; if you delete a dimension style because you think; "I don't need him any more." But you're wrong. Or somebody else goes further with the drawing and needs to draw something with another scale. You need to copy the 'wanted' dimension style from another (new/ excisting) drawing. Could somebody help me? This is the whole macro; ^C^C_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;1;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 1";_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;2;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 2";_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;10;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 10";_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;20;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 20";_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;50;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 50";_dimclrd;1;dimltype;continuous;_dimlwd;-1;_dimdle;1.25;_dimdli;1.25;_dimclre;1;_dimltex1;continuous;_dimltex2;continuous;_dimlwe;-1;_dimexe;1.25;_dimexo;1.25;_dimblk;"";_dimldrblk;"";_dimasz;2;_dimcen;0;-style;;iso.shx;a;;;0;;;;;no;_dimtxsty;standard;_Dimclrt;2;_dimtfill;1;_dimtxt;1.8;_dimtad;1;_dimgap;1;_dimtoh;off;_dimtih;off;_dimtmove;0;_dimscale;100;_dimdec;0;_dimzin;0;_dimtolj;0;_dimse1;off;_dimse2;off;_dimrnd;5;_dimtofl;on;-dimstyle;s;"scale 100"; Thanks
  14. I am a pipe drafter using FabMEP15 when I need a fitting we have ITM button Menu where I can use my mouse to select the fitting ITM that I need. Instead of selecting the Fitting itm icon with my mouse I would love to instead type a command that would select the itm instead is this possible? I don't care how long the command is, because I would make the command into a macro using my gaming mouse.
  15. Hi! I would like a macro which will add a text attribute from an x-ref file to another block attribute which is up to 1.5m around the x-ref element. example: Attribute block: WF-PC-L2.0-095 X-REF attribute: L2.0-0368 I' d like to add L2.0-0368 to WF-PC-L2.0-095. The distance between the 2 attributes is no more than 1.5m perimetrically. I guess coordinates can be the common reference, but i am not faamiliar with coding..
  16. Is it possible to create a macro, and turn that macro into a keyboard shortcut that will THAW, your most recent turned off layer, or layers if multiple were frozen at the same time? This would be super helpful if somebody could help me out here! Thanks, Matt W.
  17. HI Is there a way to run a macro using keyboard shortcut key (acad.pgp)? I would love to add the following to the PGP file if possible. I added the following to the DIMLINEAR command button and it works: ^C^C-layer;Set;DIMENSIONS;;^C^C_dimlinear\\\\ ^C^C-layer;Set;0;;^C^C I found this one that is better than the one i made for the dimlinear button: ^C^C_setenv;CURRENTLAYER;$M=$(getvar,CLAYER);CLAYER;Dim;_dimlinear;\\\ CLAYER;$M="$(getenv,CURRENTLAYER)"; Thanks DRBJR45
  18. Is it possible when Activating a project in Autocad Electrical to run a customized script or macro? Specifically, it would be nice to set the "DefaultFormatForSave" variable to the proper customer specified value. Thanks in advance
  19. Hi guys, long time no post. I have a LOT of drawings all with the same block in and I have updated the block so therefore want to redefine all the blocks, ...as you do. I only have autocad LT 2010 so havent got the LISP coding option. I am trying to do it by assigning the following example code to a button and running it. The only problem is it doesn't run it properly... block name for example is 'box' C^C^_-insert;box=C:\users\michael\desktop\box.dwg;y;C^C^ All the individual lines work when typed but when used in the button macro it stops at: C^C^_-insert;box=C: ...and doesnt accept the backslash and so stops the macro from continuing. How can I get it to run a file path??? this is doing my swede in
  20. I keep doing the same commands over and over and I think i can use a macro to take some of the work out of my repetitive task. I pick "spline" and then type "near" (osnap), pick the first object then pick a spot in space then type "near" (osnap) and pick last object (end of routine). so would the macro look something like: ^C^C_spline;near;\\near;\; Thanks, Steve
  21. I'm just learning how to utilize recordable macros. I have a simple one that I found how to assign to a tool palette by simply changing the properties command string to "^C^CBottom" and "^C^CTop". These are the titles of the macros I created. The article I found explaining this said you can also assign a shortcut key using the aliaseditor but it does not recognize it as a valid command. Is there a way to either use the aliaseditor or the CUI to assign a shortcut for these recoded macros? Thanks, -Nobull
  22. Jrbuds

    Macro Help

    Hi, I am trying to create a macro (or lisp) and am struggling to find how I would do it. Basically what I want to achieve is this: Click Custom button, Click first point (p1) Click second point (p2) Insert block at p1 and set scale to equal distance between p1 and p2 Set bearing to the bearing between p1 and p2 then end. The process will take 3 clicks including click the custom button. This is to basically speed up inserting doors. I was thinking possible making it draw a line when you click p1 and p2 then use this line to grab the start of line, end of line and bearing. Or using variables. Any help would be appreciated, or pointing in the right direction. I don't expect anyone to do all the work for me, just a hint would be awesome.
  23. I have generated the following Macro in a drop down menu for quick insertion of some of my company's standard blocks. I want to know how to add the function explode to the command so as soon as I have placed the block using the macro it exploded on placement or selection of the macro. ^C^C-insert;F:/Blocks/CAN.dwg
  24. Hi all, I am encountering a strange problem: Which ever "multiple" command I enter - I get aforementioned error. Example Command: ^C^C_Selectsimilar;\;change;p;c;7;; Unknown command "^C^C_SELECTSIMILAR;\;CHANGE;P;C;7;;". Press F1 for help. _Selectsimilar;\;change gives me the same error. every multiple command I try to enter in command prompt - gives me the error. Among others, I tried the commands Tuns mentioned in another topic: Command: Select;p;; Unknown command "SELECT;P;;". Press F1 for help. Not to be odd enough - If I make a toolbar button and assign the very same macro to it - the press on the button executes the command(s) successfully I am new to macros and I need to experiment a bit before I "hit the pot" - so the solution with the buttons are not applicable. Any advice how to resolve this problem? Thanks in advance, cheers p.s. - F1 is a very nice button (in AC). Beautiful letter, number... Cute. It is a shame it don't have some cool function, like for example - useful help... ------------------------------------- Autocad 2014 Advance Steel 2013
  25. Hi All I cave created a new drop down menu using the Customize User Interface in AutoCad 2011 called Load Aerial Photography with a sub menu called Insert Tiles. When selecting my new menu I would like to have a macro that browses to where our JPEG Aerial Photos are kept on our network. At the moment I have to select the AutoCad pull down:- Insert, Raster Image Referance then browse to M:\DATA\AERIAL_PHOTOS\2012\84235\RGB_10cm_1km_Jpeg_Tiles If there is a user on this Forum who can put together a Macro that will browse to the above filepath I would be very grateful as I'm really getting nowhere with this. Thanks Paul
×