Jump to content

Search the Community

Showing results for tags 'macro'.

  • 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

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Dear team , I used etransmit command >add file than bind xref option, but not bind in current drawing. Is any tools or lisp, VBA macro for add multiple xref and bind together in current file and save as a zip file.? Note :, Xref not attached in current drawing. I need to attach multiple and bind together in current drawing. Thanks
  2. hi can anyone here help write a lisp routine that can be run project wide to hide/show attributes . The user must be given an option to select an object , write or select attribute name and also select multiple drawings from the project. I have a code that updates the attribute value , attaching that - Please help change that to hide/show attributes updateATTRIB.lsp
  3. I found valuable lisp for auto creation block. I want to improve this lisp to following requirement * block selected object individually, not in one block thanks AUTO-BLOCK.LSP
  4. Hi, I'm having a hard time figuring out how to make a toolbar that can be downloaded for all to use. My problem is how do you share a "common directory" with the world? The toolbar works perfectly fine on my computer, because I have defined my own directory in the macro under the cui command. So the question is: how do you make a "common directory" so that the toolbar can be accessed on any computer? I hope I have made myself clear. Thanks!
  5. 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!
  6. 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.
  7. 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
  8. 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
  9. 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?
  10. 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
  11. 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
  12. 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
  13. 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!!
  14. 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
  15. 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.
  16. 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.
  17. 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
  18. 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.
  19. 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..
  20. 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.
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
×
×
  • Create New...