Jump to content

Search the Community

Showing results for tags 'script'.



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
  • Autodesk Revit
    • Revit General
    • Revit Architecture
    • Revit MEP
    • Revit Structure
  • Autodesk 3ds Max
    • 3D Modelling
    • UVW Mapping, Textures & Materials
    • Cameras, Lighting & Rendering
    • Rigging & Animation
    • 3ds Max General
    • Infrastructure, Architecture & Landscape Visualisation
  • Other Autodesk Products
    • Autodesk Software General
    • Autodesk Inventor
  • Digital Design
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Web Design
    • 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...

Joined

  • Start

    End


Group


Real Name


Biography


Location


Interests


Occupation


Discipline


Discipline details


Main CAD Product


Current Product Version


First AutoCAD Version


Other Applications


Operating System


Computer


Monitor


Motherboard


CPU


RAM


Graphics


Primary Storage


Secondary Storage

Found 51 results

  1. Hi, Recently been testing the water with writing scripts to try and automate some of the functions that I do repetitively so a newbie to this. Unfortunately only have access to AutoCAD LT so can't use LISP or anything. Have tried the ^C^C and (command) suggested in other forums. Essentially my script something like this: -layer set Datum LINE 0,-14000 850000,-14000 -INSERT BLOCK1 10000,20000 1 1 0 20000,20000 1 1 0 30000,20000 1 1 0 -INSERT BLOCK2 37000,7000 1 1 0 When I run it in CAD it keeps asking for an insertion point for BLOCK1 (even though I don't want more than 3 in the drawing) - how do I escape this command and move onto next line of commands (insert BLOCK2). Essentially I want equivalent of escape key. Can't find answer anywhere. Thanks in advance
  2. Hello dear community, My task is to validate coordinates of antenna changes for a mobile network; this list is supplied in Excel format an the respective points are introduced in matlab on separate layers for each antenna change, e.g. AC_1>2, AC_5>100, AC_80>34, ... On another layer are the locations of the antennae as points. I want to validate that no antenna change (AC) takes place too far away from that antenna. I have developed a process to do this, yet I still don't have figured out how to do each step. Process: For each antenna (how are for-loops done?) 1. disable (make layers non-visible) all non-relevant layers for this antenna Solution: -layer au *_* ei *45_*,*_45* 2. Connect all remaining visible points with lines (e.g. tree spanning algorithm) 3. Center to the region containing all remaining points and set a predetermined scale (allows to validate distances on paper with ruler after printing) 4. Print to a pdf A3 with same scale always However I do not know how to loop over antennas and don't know how to implement steps 2-4. I would be very thankful if you could provide me same valuable tips. My knowledge in AutoCAD is not very developed, but I have strong programming knowledge. Thank you in advance.
  3. Hello All, I am trying to remove one table from my drawings. Please take a look at the attached sample dwg. I have over 8000 drawings to modify. All drawings contains 3 tables as shown in sample drawing. I want to erase table 3. The location of the table 3 can be anywhere in with in outside border. tried many things. but no luck so far. right now i have an autolisp that works fine if i run it in one drawing. but it doesn't work while running thru script. (defun c:abcd() (setq ss1 (ssget)) (command "erase" "p" "" ) (command "zoom" "e" "") (command "qsave") (princ) ) i have a scrip that loads the autolisp containing the above code. any help would be really appreciated. TEST DWG.dwg
  4. Hi All. I was wondering if anyone knows of a tool or a way to basically, batch PDF multiple viewports or specific coordinates within a paper layout. I have an A0 drawing where i need a print of the A0 drawing, and multiple grids set to A4 then a Jpeg showing the full plan with the grids on. I have set up a script using the -plot command and set the Coordinates for each grid. However it is a bit slow and cumbersome to do this on multiple drawings. Does anyone know of a way to maybe either through a script or a lisp, to open a drawing. Find certain instances of a block or polyline and print (with certain parameters like include an outline of 10mm around the edge of the grid) and when it has no more blocks to search for, it saves, closes and opens next drawing to search and print? Any help is very much appreciated. Thanks
  5. Hi, I need to run a scrit on multiple files and I would like it To chose wich SCR to run bas on the begining of the Name of the DWG File. In this case i have file with 2436, 3648 etc... and my scr would need to run the 2436INS.SCR on the 2436 ans same thing with the 3648 etc... I have try using Script Pro 2.0 But as it's openning a new file that has nothing in it it wont run proprelly the srcip. Here's my .scr Also Got it in Macro Command I would at least be able to run it in Script Pro but if someone is able to make a.bat or a lisp quith that it would be so fantastic I'm really sorry for my bad english! Thanks to every one!
  6. I am trying to script a counter of specific strings. How can I select all occurrences of text that has a specific value? I cannot use filter or quickselect, and I cannot get selection sets to find specified values. Any help would be greatly appreciated. I am using ACADE 2015.
  7. I have a client who used Simplex.shx font all over their drawing package. Is there a way to use Simplex.ttf in a text style instead? I have read and searched all over and haven't gotten anything to work. When I go to my style manager Simplex_IV25 and SimplexIV_IV50 are the only true type fonts I can use of Simplex. They are wider and bolder than the regular version, which is not selectable. I would like to change the style using a script on my 300+ drawings so that when we convert to PDF it is searchable. I cannot use either Simplex_IV25 or Simplex_IV50 because the clients would notice and would complain, it would also throw alignment off. I am using ACADE 2015. Any other info needed, I can gladly give. Thanks
  8. 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
  9. Hi, I want to make a script who draw circles in multiple Points. The Points are automaticly made in a extension to autocad. All the Points are in same layers. It´s around 200 to 1000 Points in the drawing. My first issue is to find a commando who draw circles, with basepoints in all Points. Does anyone know the appropriate command for me? Regards, Emil
  10. 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
  11. Hello, I have some drawings that requires CONVERTPSTYLES run to be able to use the plot style .ctb files. Otherwise it shows missing. So, I have created a script per below (btw my first script ever ). CONVERTPSTYLES QSAVE QUIT This script works well if all the files in folder has the issue of missing plot style. If any one file is not having this issue, then the script stops. I noticed that the CONVERTPSTYLES is having two different responses and if the file does not have any issue, then it pops-up different window causing my script to stop. The first image is the normal pop-up and once okayed. command closes for the problematic files (works perfectly). Second image is the additional pop-up looking for some files when the file is having no issues. Any suggestions
  12. Hey all, this is my first post so I'm sorry if I violate any of the forum rules. I appreciate the help! I'm trying to write a script to get the latest revision number from our drawings, then save that info into a text or CSV file. Each drawing has a revision block like the image tagged below. How would I do that in LISP? Thanks!
  13. I am creating a copy from a drawing with Autolisp and creating a script which will be dettaching all xrefs on the copy. After saving the copy, the last command of the script is "close", then I would like to go back to the original drawing from where the copy was made from. This is not happening if there are some other drawings opened, then it makes active the last opened drawing. I need an automatic process since I will not be the final user and they might get confused. Here it is the code: (defun run (/ mc_scr) (setq switch_dwg (strcat (getvar 'dwgprefix) (getvar 'dwgname) ) ) (setq mc_scr (open (strcat (getenv "temp") "\\mc.scr") "w")) (foreach mem0 (list "open" (strcat "\"" new_c "\"") "(setq opn_dwg_lst nil)" "(vlax-for" " x" " (vla-get-documents" " (vlax-get-acad-object)" " )" " (setq opn_dwg_lst (cons x opn_dwg_lst))" ")" "-xref" "d" "*" "-purge" "a" "*" "n" "_ucs" "_w" "_plan" "_w" "_zoom" "_e" "(foreach SYM_MEM opn_dwg_lst" " (if " " (=" " (strcat" " \"A\"" " (substr" " (getvar \"dwgname\")" " 2" " )" " )" " (vla-get-name SYM_MEM)" " )" " (setq SYM_A SYM_MEM)" " )" ")" "qsave" "close" "(vla-activate SYM_A)" ) (write-line mem0 mc_scr) ) (close mc_scr) ) (defun mc (/ new_c mc) (setvar 'CMDECHO 0) (if (= (substr (getvar 'dwgname) 1 2 ) "A_" ) (progn (command "qsave") (setq new_c (strcat (getvar 'dwgprefix) (vl-string-subst "B_" "A_" (getvar 'dwgname)) ) ) (cond ( (/= (findfile new_c) nil) (command "save" new_c "y") (run) ) (T (command "save" new_c) (run) ) ) (command "script" (strcat (getenv "temp") "\\mc.scr")) ) ) (setvar 'CMDECHO 1) (princ) ) (mc) Any clue? thanks in advance Svorgodne
  14. I have created a .cuix file that I would like to apply to AutoCAD2015 for each user on the network, so that I do not have to log in under each name and manually transfer in the CUI one at a time. So far I have tried multiple methods for loading the custom .cuix file into AutoCAD on launch, however I am unable to get the workspace to transfer in at all. I have created an acaddoc.lsp file, saved into a support file path, that calls another .lsp file to load in the cuix, based on code I have seen on this forum: (command "cuiunload" "FILENAME" ^C "cuiload" "X:\XX\XXX\FILENAME.cuix" ^C) However my new workspace is never added into the program after successfully calling the LSP when CAD launches. I have also messed around with ARG files and using a switch to call on a script upon launching CAD, although I so far have not had any luck. I am a novice at writing scripts for AutoCAD and navigating the program's folders, so please let me know if I need to provide any more detailed information. I appreciate any help that someone has to offer. Thanks.
  15. Hello everybody! Few programmers (including myself) decided to create a website with free (for now) AutoLisp programs and scripts for Autocad. Well, we have few questions to define where to start. Your answers would really help. - Do you use programs (scripts) in your work? - Which program (script) you would use but do not have. Best regards, ... PS Link to website asap
  16. Hi all I really do not have much experience with AutoLISP but I would like to write a script that allows me to: 1. Create a new DWG 2. Draw a line from a set of existing coordinates from a .txt file 3. Save this drawing in a specified location 4. Close the drawing 5. Rinse and repeat until all of the .txt files have been drawn. Basically this will be used for hundreds of .txt files containing coordinates to draw the cross-sections of a tunnel. Is this something that can be done? As after hours of research I have only managed to be able to draw one cross-section using a batch file but haven't been able to close the drawing or save it. Thanks in advance for any help
  17. Hi, this is my first post on the forum & I'm also pretty new to AutoCAD scripts & Lisp routines, so please bear with me. Basically I have the following script: (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.saveas 2010 !dn This script saves my current drawing as 'New Drawing.dwg' within my current directory, and works fine. When I try to modify the script to the following, which attempts to open instead instead of save, it doesn't work, just prompts for drawing name: - (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.open !dn The saveas & open dialogues look very similar, so please could someone explain why I can reference a variable for the _.saveas filename, but not for the _.open filename, or have I got the syntax completely wrong for the _.open command?
  18. Hi guys! I try this http://askjerry.info/weird_gear/ to get a gear of two SQUARE tooth wheels. I have downloaded and installed ACAD especially for the project. For now I could run the script to get a result curve (made out from big white wheel on the left) for primitives (triangle, square, ellipse, etc.) I draw in small red circle on the right. Almost everything seems to be okay but when I try to paste there (to the right red circle) ready made and complicated pattern (tooth wheel) from another CAD software the script goes ERROR. Where my mistake is? Please answer in most common words to let me know you’re interested in further conversation. Then I put more specific and detailed questions. Truly, Alex.
  19. I've made this script to adjust the extensions on our rectangular transition ducts but it doesn't want to work for me. Everything is fine if I keep it simple and leave out the " Or "Ductmate 35" " part but for this to work, I will need the or statement. Anyways, here's the script... select item.cid case 2 dim extin = item.dim[6].numvalue dim extout = item.dim[7].numvalue dim con1 = item.connector[1].value dim con2 = item.connector[2].value if ( con1 = ("TDC" or "Ductmate 35") ) and (extin < 2 ) then item.dim[6].value = 2 end if if ( con2 = ("TDC" or "Ductmate 35") ) and (extout < 2 ) then item.dim[7].value = 2 end if if ( con1 <> ("TDC" or "Ductmate 35") ) and (extin < 0.5 ) then item.dim[6].value = 0.5 end if if ( con2 <> ("TDC" or "Ductmate 35") ) and (extout < 0.5 ) then item.dim[7].value = 0.5 end if item.update() end select Can anyone spot the problem? I'm hoping its an embarrassingly simple one.
  20. Hi, I am working in Fabrication and am trying to make a lisp that will select all items of a certain cid# (4 and 61) and then run a ctext on them. The lisp is also supposed to run a script at the same time, but that part works fine. This is my code so far... (defun c:etag() (setq ss (ssget)) (setvar "pickfirst" 1) (sssetfirst nil ss) (executescript "Elbow Tagger.cod") if item.cid = 4, 61 then (addctext "AMCI-Full-Elbow-Tag") end if end select) Currently, this lisp will apply the ctext to very part selected. I am only familiar with VB so I was a little lost when trying to tell the lisp to select cid#
  21. First post so cut me some slack if this isn't in the right spot! I have software that creates a script file and essentially dumps circles into AutoCad. The manual part is using rulesurf to connect them (each circle has a different 'z' elevation - and x,y for that matter). Basically, I'm trying to further automate the process and create the 3D image with minimal user input. I've played around with the rulesurf command in the .scr file but I'm not having any luck. Two of the circles and the rulesurf attempt is below - I add the radius of the circle to the center point's 'y' value in order to select the object circle 3.76,-4.83,-190.00 59.00 circle 3.72,-5.03,-310.00 59.00 surftab1 30 rulesurf 3.76,54.17,-190.00 3.72,53.97,-310.00 The weird thing is, when I look at the command window after the failed attempt, I can see my x,y,z point I use to find the circle being rejected When I type the x,y,z point in manually it never has issue finding the circle. I'm using ACAD 2015 with a acad3D.dwt file. Any advice would be great as I'm just getting started with my dive into .scr files and the POWER they hold! Recommended readings would be awesome too. I'm a darn good drafter now working on my engineering degree - so I'm not afraid to learn or take criticism! Thanks
  22. HI, I HAVE A SIMPLE SCRIPT FILE THAT PRINTS SPECIFIC TABS INSIDE A CAD FILE, IS IT POSSIBLE TO CHANGE THIS TO MAKE IT PLOT MULTIPLE TABS "LAYOUTS" IN THE SAME FILE, BASICALLY WILL BECOME EQUIVALENT TO A PUBLISH "BATCH PLOT" COMMAND. -PLOT Y PV2.00 DWG TO PDF.PC3 ARCH full bleed E1 (30.00 x 42.00 Inches) I L N L F Y SoCore_2014.ctb Y Y Y N N Y Y THNX
  23. 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
  24. Hello, I am working on a tunnel alignment. I have to draw multiple closed 3d polylines from AutoCAD Points (which form the tunnel sections from the excavation). I use the 3POLY command and then the option "PN. Is it possible to write a script (or a lisp routine) that repeats this process? For example, I wrote this script 3POLY 'PN 1-10,1 (1 row blank) 3POLY 'PN 11-20,11 It draws the first closed 3dpoly (from point numbers 1 to 10 and closes to 1) but it not continues to second 3poly. Thank you in advance
  25. Hi! I'm looking for a script that does this: insert block from specific (non changing) folder, *type in name of block* no rotation no scaling insert to picked point on screen (meaning- i only want to type the name end pick a point of insertion) any ideas? thanks a lot!
×