Jump to content

Search the Community

Showing results for tags 'autolisp'.

  • 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. AutoLISP and VisualLISP expert required for developing and improving our company’s custom LISP routines? We are an Architectural firm and create all our drawings (Plans, Sections, Elevations and Details) in 2D with “Color based plotting (CTBs)”. We mainly use vanilla AutoCAD 2006-2013 and also have BDS Premium subscription. We have a legacy process where we assemble our 2D architectural drawings in a “multi-layered cake” kind of format. Each level/floor has same few layers (e.g. Lvl 1 = W_1, N_1 H_1, Lvl 2 = W_2, N_2, H_2). We use CTB for plotting and have a collection of very simple legacy AutoLisp routines that do the following: • Create new layers per our standards • Isolate layers in modelspace or pspace viewports by the level • Deal with xRef layers • Basic polyline, area, etc. functions • Etc. The job involves developing a single AutoLISP file or a suite of files (*.lsp + *.dcl + *.arx + *.vlx). You will be explained the intent and desired end-result of each routine. You will have a free hand to come up with the code, algorithm and even suggest better ways of doing things. Maybe even adding to the repertoire of macros we have. Here are the criteria for the job. • Your work will be submitted to and evaluated by the CAD Managers and AutoLISP experts in the office. • The AutoLisp code should be well structured, logical, efficient and well documented so we can “tweak” it in future. • The code should be “future proof”, portable and cognizant of changes that AutoDESK can make to AutoCAD in the future • You may suggest newer interface features and ARX/.NET/VBA in addition to DCL for improving the interface. • You will have access via RDP (remote desktop) to our environment (Mixed AutoCAD and ACA 2013) for testing and debugging. • You will use exisiting built-in features, express tools and “open source”internet code rather than re-inventing the wheel. • Generic AutoCAD Architecture features (e.g. AEC Modify Tools) can be used when they are the best option. The quality of your work may lead to an ongoing relationship and contract work. Thank you in advance for your interest and consideration.
  2. How can we copy an object in a drawing and paste it at multiple places using Autolisp. I have a dwg template that having many symbols in it. i have to use that symbols again and again in drawing. which symbol i want to use i select it than right click and copy and paste where i want to use. same thing happens for all the symbols whenever i need them. can we directly copy a particular object (hatch symbols, block etc) and paste it wherever we need it using Autolisp. We don't want to go to the original symbol location to select it and copy it to paste where we want to use it using Autolisp.: roll:
  3. Hi everyone, this is a new plugin for AutoCAD: http://www.yourspreadsheets.co.uk/yourlisp.html It helps me load all lisp files in selected folders, rather than add one by one as AutoCAD Startup Suite. Then, I don't need to copy all my lisps to 1 file, but keep my lisp library in an organized tree hierarchy, while still be able to load them easily.
  4. Does any body have any idea how can we find out the Text and Polyline intersection location using Autolisp? It will be better if we can mark error circles on a perticular layer on the intersection. Thanks in advance
  5. Hi All, I'm doing a lisp and trying to display an error message on the screen to whats wrong and why it can not continue. Here are my error message. It should only be one displayed. Currently its doing both of these. Can someone let me know why its doing this? "*** Error *** Drawing unit is not Metric. Try Inch option" "*** Error *** Drawing unit is not Inches. Try Metric option" Please excuse my "NOT-SO-CLEAN" LISP coding method. I have posted truncated LISP and some of the defun mentioned here are not attached. Thanks, (defun C:PRES2A (/ OIU Dunits) (setq OIU (getvar "insunits")) (initget "I M") (setq Dunits (getkword "\nIs this Inch template or Metric? (I,M) <Inches>:")) (if (= Dunits nil) (setq Dunits "I")) (if (and (= Dunits "I") (= OIU 1) (not (tblsearch "LAYER" "FORMAT")) ) (progn (Inch) (blkrem) (alert "\nblocks cleaning complete.") ); end progn (princ "\n*** Error *** Drawing unit is not Inches. Try Metric option") );end if (if (and (= Dunits "M") (= OIU 4) (not (tblsearch "LAYER" "FORMAT")) ) (progn (Metric) (blkrem) (alert "\nBlocks cleaning complete.") ); end progn (princ "\n*** Error *** Drawing unit is not Metric. Try Inch option") );end if (princ) ) ; end of program
  6. Hi all, I'm stuck inside the while loop and can't come out of it. Can someone help me on this (if possible please provide information on why its not closing). This is just a small function of a much larger lisp that I'm playing with and Esc to exit means complete program termination. Here is how I inteded it to be used for. Once user decides to use drawshapes, and if the answer is one of the keyword (eg. Rectangle) then user should be able draw as many rectangles he likes and if Enter is hit it should come back to main menu again ask for keyword to choose (circle or ellipse). Thanks in advance. (defun drawshapes (/ dtype) (setvar "cmdecho" 1) (setq dtype T) (while dtype (initget (+ 2 4) "R P C E") (prompt "\n*** Enter option R, P, C, E ***") (setq dtype (getkword "\nselect your option: Rectangle, Pline, Circle, Ellipse or hit Enter to close:")) (if dtype (cond ( (= dtype "R") (setq loop T) (while loop (command "_.rectang") (while (= 1 (logand 1 (getvar 'CMDACTIVE)))(command pause)) ); end while ) ( (= dtype "P") (setq loop T) (while loop (command "_.PLINE") (while (= 1 (logand 1 (getvar 'CMDACTIVE)))(command pause)) ); end while ) ( (= dtype "C") (setq loop T) (while loop (command "_.circle") (while (= 1 (logand 1 (getvar 'CMDACTIVE)))(command pause)) ); end while ) ( (= dtype "E") (setq loop T) (while loop (command "Ellipse") (while (= 1 (logand 1 (getvar 'CMDACTIVE)))(command pause)) ); end while ) ); end cond ); end if ); end while (setvar "cmdecho" 0) );end defun
  7. Hi to all, I'm curious to know which editor you guys use for Autolisp codes. What all are out there. I'm currently using Notepad and I do not find that easy at all. I havent tried Vlide yet...are there any better options? Thanks,
  8. Hi all, I have a small question here. Is it possible in autoCAD (or via lisp) that when I draw a polyline and when I reach the first point again (from where I have started), the command terminates and give me a closed polyline. And if I dont reach to the first point, it automatically closes to the first point. This is just me make sure I'm not keeping the loop open for hatching? Any help is appriciated.
  9. Hi to all, So, this is my lisp. It does the following: 1) Adds revision clouds to multiple entities 2) Adds Layer (or create if required and add properties) 3) Adds hatch 4) Inserts a block for leader and text (already formated) I have very limited knowledge of the lisp. As you can see I have copied few different codes and combined it to make it work for my application. It works but I know this is not systematic at all. I dont know if my error handeling is correct. One thing that I wish to add is if the revision cloud is too big or too small, it should allow to do that without closing and undoing everything. In other sense, I need undo and reset arc length option in this. Can someone help me on this please? (defun c:RVC6 (/ *error* oce mflag ans) ;************************************Error handling********************************************* (defun *error* (msg) (setvar "cmdecho" OCE) (setq *error* nil) (princ "\nRevision cloud program is done.") (princ) ) ;************************************Program begins********************************************* (setq OCE (getvar "cmdecho") OOS (getvar "osmode") ) (setvar "cmdecho" 0) (setq mflag nil) (while (not mflag) (prompt "\n*** Enter option C, H, L, or E ***") (initget 0 "Cloud Hatch Leader Exit") (setq Ans (getkword "\nconvert to revision Cloud/Hatch/Leader/<Exit>: ")) (if (= Ans nil) (setq Ans "Exit") ) ;end if (cond ( (= Ans "Cloud") (convcloud) ) ( (= Ans "Hatch") (Addhatch) ) ( (= Ans "Leader") (Addleader) ) ( (= Ans "Exit") (setvar "cmdecho" OCE) (setvar "osmode" OOS) (quit) ) ) ;end cond );end while );end defun ;************************************Program ends********************************************** ;*******************************Start of "convcloud" program*********************************** (defun convcloud (/ al ss) (initget (+ 2 4)) (setq al (getreal "Specify Arc length <0.5>:")) (if (= al nil) ;If user do not input a value here (setq al 0.5) ;Consider "Enter" as 0.5 ) ; end if (if (setq ss (ssget '((0 . "LINE,*POLYLINE,CIRCLE,ELLIPSE,SPLINE,ARC")))) (progn (repeat (setq i (sslength ss)) (command "_.revcloud" "a" al al "" (ssname ss (setq i (1- i))) "") (if (not (tblsearch "LAYER" "CONSTRUCTION")) (command "-layer" "N" "CONSTRUCTION" "C" "1" "CONSTRUCTION" "LT" "continuous" "CONSTRUCTION" "") ) ; end if (command ".-layer" "S" "CONSTRUCTION" "C" "red" "" "") (Command "Chprop" "l" "" "la" "CONSTRUCTION" "C" "BYLAYER" "Lt" "BYLAYER" "LW" "BYLAYER" "") );end repeat (princ "\nRevision cloud(s) created on CONSTRUCTION layer.") );end progn (princ "\nNo objects selected.") ) );end defun ;*******************************End of "convcloud" program************************************* ;*****************************Start of "Addhatch" Program ************************************* (defun Addhatch (/ htype selset thisobj setlen entname) (initget 1 "D R") (setq htype (getkword "\nSpecify hatch type? Demo(D)/Rebuild(R):")) (if (= htype "D") (setq htype "ANSI31") ) ;end if (if (= htype "R") (setq htype "DOTS") ) ;end if (princ "\nSelect object(s) to hatch:") (setq selset (ssget)) (if selset (progn (setq thisobj 0) (setq setlen (sslength selset)) (while (< thisobj setlen ) (setq entname(ssname selset thisobj)) (Command "-bhatch" "Advanced" "Style" "Outer" "" "") (command "-bhatch" "p" htype "3" "" "s" entname "" "") (if (not (tblsearch "LAYER" "CONSTRUCTION")) (command "-layer" "N" "CONSTRUCTION" "C" "1" "CONSTRUCTION" "LT" "continuous" "CONSTRUCTION" "") ) ; end if (command ".-layer" "S" "CONSTRUCTION" "C" "red" "" "") (Command "Chprop" "l" "" "la" "CONSTRUCTION" "C" "BYLAYER" "Lt" "BYLAYER" "LW" "BYLAYER" "") (setq thisobj(+ thisobj 1)) ) ; end while (alert "\n ***WARNING*** Hatching could not skip the inner objects. To solve this, Double click hatch and `Add: select objects' and select inner object & click OK") ) ; end progn ) ;end if selset (princ "\nNo objects selected.") );end defun ;*******************************End of "Addhatch" program************************************* ;*****************************Start of "Addleader" Program *********************************** (defun Addleader (/ pt1) (while (setq pt1 (getpoint "\nInserting task description note, Specify Arrow End Point or hit Enter to close:")) (Command "_INSERT" "CP TEXT" pt1 "" "" "") (command "explode" "l") );end while );end defun
  10. Hi, all: I have a trouble with dealing Insert entity. I got a "Block" named "AA", which have one "lwpolyline" entities inside. And then I insert it with "scaling & rotating". The problem is, if I want to get the current outline of "Insert". My process is as below. 1. get "Block entity" from "Insert entity" 2. get "lwpolyline" from "Block entity" 3. transform the "lwpolyline" by vla-transformby(...) function with "Insert entity" rotation, scale ... parameters 4. draw the renewed "lwpolyline" on drawing as outline It works, but I think it cost a lot of times. Is there any convenient way to do this? thanks!
  11. dalivore

    Autolisp Help

    Does anyone know how to create a lisp that will export a csv file with object data and coordinates? Example; od field 1, od field 2,etc... x1,y1,z1,x2,y2,z2,etc.... Ideally it should be able to report all object data fields irregardless of the number. And it should report all xyz coordinates of polylines. I would also need a lisp to import csv files from the above format. If your curious this is all in an attempt to solve the 4 coordinate limits that map3d puts on exporting shape files... If someone has an alternate solution to that, I'm all ears! Dalivore
  12. Hey All, Okay so I have s dynamic block (green in my example) that is built in the x-y plane. I can change its length, width, extend it and rotate it about the base point. Yada yada yada. Bunch of feature that the company I work for needs. When we insert it into a 3D model we position it such that the Y axis becomes the Z axis and the the X axis can be anywhere within the the X-Y plane. I am trying to create a lisp that will move it relative to a second block (red in my example). Does any know a way to get the rotational information for the dynamic blocks. I can't use the "Rotation" from the misc section since it operate in the blocks x-y plane instead of the models x-y plane. I created an image below with Axis. To hopefully clarify. These aren't the actual blocks just example shapes. Hopefully someone can help. I have tried a few things without success.
  13. I have two different blocks overlapped on each other which have similar or same geometries. I want to verify the visual difference on both the blocks. I want to verify if the vendor block contains the same geometry as mine. Here is what I'm thinking and Need lisp for: I want to select the first block, deselect it, select the other one, deselect it and then this process should be looped till I can visaully find difference between blocks by select/highlight method without grips. If possible to add timer between selection & deselection process would make things easier and allow zoom and pan while still looping. Can anybody help me please?
  14. Hi everyone, I'm making quantity tables from entities in a drawing and I need to add "flagging system" which will alert the user when any kind of modification has been made in a specific layer (I'm talking about the content of the layer = entities, not layer definitions like color and so). I've already looked for many solutions, but it seems that the way to go is to add a reactor to a layer (or to each layer ???) I just started AutoLisp and I'm not feeling ready to dive into reactors w/o being crushed Theoretically I need something like ("myreactor" "catchanychangetocontent" "LayerName") -> return T if there's been a change (like a new entity etc etc) I really need help on this one, Tks !
  15. Hello everyone I have wanted to create some type of LISP for a long time now. Iv done 1000's of handrail drawing in the past few years, and expect to do many many more. These rails are 1.50 x 1.50 square tubing, 16ga wall, 304 stainless or Mild Steel. The standard height is 42" which should never change. There are only a few variables when drawing these. When you have a handrail that has more than just the end uprights, the center distance of uprights can be no larger than 42". When a handrail is short enough to not need intermediate uprights, the center distance can be no larger than 50". I have included a sample drawing of how I layout my rail drawing for the shop to fabricate. I have shown, a rail with multiple uprights and one short one that doesn't require intermediate uprights. I would love to have a LISP designed to have a dialog box pop up that ask for: Handrail Length: 4" - 240" Material: Stainless or Mild Steel Once criteria is entered, the LISP draws the handrail and then creates a cut list, like I have shown in my sample. Is it possible to dimension and place text with the same LISP program? Thanks for all the help everyone! AJ Here is the sample file I have put together as an example of how I draw my shop drawings. SAMPLE.dwg
  16. I am trying to execute Undo back with some predictability from a LISP routine. Is there any way to suppress (or force the "yes" prompt) even if Undo Back is executed more than once in a row?
  17. (getstring T "\nType any string and a Space: ") If I type "Sample Only " the result is "Sample Only" in which there is no space on the last string. Is there any way to recognize the Space on the last string? BTW i'm trying to prefix a string with a spacebar between those two strings.
  18. working with some old code that I'm not to familiar with, the original writter used a different defun methood that I don't understand. Example (defun f:SC_GETINSPTS ( I can't run the lisp unless I change the "f" to a "c". Why is this? how can I run it without changing the code?
  19. My name is Neil and I am new at autolisp. I am trying to write a lisp file that will explode all blocks but the ones selected by the user. The purpose for this is when I receive a file from architect that I will be using as a base file for my work I want to be able to explode all the blocks. Some times the architect use blocks with attributes for room tags. Which I do not want to explode. Below is the code I have written so far. I may be going about it all wrong so if there is a better way please let me know. Also if you could explain any code you post so that I may be able to learn. Below is my code: (defun C:eselected () (Prompt "Select all blocks you do not want to explode. ") (setq a (ssget "_X" '((0 . "INSERT")))) (setq b (ssget())) (setq c (?)) (command "_.explode" c "") (princ) )
  20. Hello! I was wondering how I would go about writing a function that would calculate the length of a diagonal of a rectangle using SQRT function? I've been trying but so far nothing! Thanks!
  21. Hi, I'm very new to lisp and I'm currently writing some to create steel sections with the main dimensions and the name of the section below. I'm having trouble adding dimensions (in a new dimension layer) to my lisp file and the text file below my section (also in a new text layer). Ive attached my lisp file and a picture of what I'm trying to achieve. Any help would be appreciated! PFC.pdf pfc.lsp
  22. Hi everybody, First thing I want to apologize if something that I wrote sounds strange. Im spanish and my english is not as good as it should be=P. Im learling little by little autolisp things, mostly strugling through examples, codes, etc... many of them from this forum so I thank you a lot ^_^. At this moment I'm developing a routine that breaks/trims walls in order to insert doors or windows, and, after looking for it a few days, I would like to know if there's a way to use a number that users input on the command line (in a getpoint) without getting an error.,... wich is that happends everytime =/. ;; HOLE-O-MaTIC 2000 ;; by Arturo Blanco Ureña. 2013 ;; Breaks "walls" in order to insert windows or doors ;; Based initialy on code from Pavel Chour http://klobouk.fsv.cvut.cz/~chour/Lisp/Chapter%206.htm (defun error1 (errmsg) (command "_undo" "_end") (setvar "CMDECHO" 1) (setvar "OSMODE" osmodevar) (setq *error* temperr) (prompt "\nAchtung!!! Verboten!!! Error!!!\n") (princ) ) (defun c:holes(/ );P1a P2a P1 P2 P3 P4 A1 A2) (setq osmodevar (getvar 'OSMODE) temperr *error* *error* error1 ) (if (not ancho) (setq ancho 1.50)) (setq Tancho (rtos ancho) P1 "Width" ) (setvar "CMDECHO" 0) (command "_undo" "_begin") (setvar "osmode" 512) ;I'm using this structure in order to go back to the menu so I can change my mind several times. ;Don't know if there's a better way =P. ;--- (while (= P1 "Width") (initget 128) (setq P1 (getpoint (strcat "\nSelect Point or [Center/Width]<" Tancho ">:"))) (cond ((numberp P1) (setq ancho P1) ;trying to recognice P1 as a number but always goes on error =/ (setq Tancho (rtos ancho)) );cond1 ((= P1 "Width")(setvar "osmode" 35) (setq ancho (getdist "\nWidth of the Door/window?:")) (setq Tancho (rtos ancho)) );cond2 );end cond );end while ;--- (cond ((= P1 "Center") (setvar "OSMODE" 518) ;If the user want to break from the center of the window. (setq P1a (getpoint (strcat "\nSelect center <" Tancho ">:"))) (setvar "OSMODE" 128) (setq P2a (getpoint P1a "\nSelect the other side of the wall:") A1 (angle P1a P2a) A2 (+ (* pi 1.5) A1) P1 (polar P1a A2 (* ancho 0.5)) P3 (polar P1a A2 (* ancho -0.5)) P2 (polar P2a A2 (* ancho 0.5)) P4 (polar P2a A2 (* ancho -0.5)) ) );end cond1 (T (setvar "osmode" 128) ;if he/she wants to start from one side (setq P2 (getpoint P1 "\nSelect the other side of the wall:")) (setvar "osmode" 512) (setq A1 (angle P1 P2) A2 (+ (* pi 1.5) A1) P3 (polar P1 A2 ancho) P4 (polar P2 A2 ancho) P1a (polar P1 A2 (* ancho 0.5)) P2a (polar P2 A2 (* ancho 0.5)) ) );end else );end cond (setvar "osmode" 512) (command "_break" P1 P3 "_break" P2 P4 "_line" P1 P2 "") (setq L1 (entlast)) (command "_line" P3 P4 "") (setq L2 (entlast)) ;I add this in order to trim extra lines in the middle of the wall. (command "_trim" L1 L2 "" "B" P1a P2a "" "") (command "_undo" "_end") (setvar "CMDECHO" 1) (setvar "OSMODE" osmodevar) (setq *error* temperr) (princ) );end As you see You can enter the "Width" to give it, but I would like to simply write down a number when asking for a point, recognize that is a number and use it as the value of the variant. If a point is entered, then continue normally. Im a bit shy and its the first time i post a code. I have used several pieces of code from others to arrange the error handling/undo and its originally based on one tutorial from Pavel Chour, so I dont know if its right that I give permission or not to use it, or even its worth it (the trim still fails and i dont really get why ) but If anyone want to use it feel free. Any tips critics and opinions are welcome also
  23. Dear Cadtutor members I am Nelly, new member of this forum and a very beginner autoCAD Civil 3D (2012 version) user. I am Indonesian who's now living in South Korea to pursue my degree. I got scholarship from a Korean's professor, so i'm doing this because of it I need help about autolisp. I am new in this area, so i just googling it and found some reference on autolisp programming, but yet still don't understand about how to program with it and anything at all I hope there's someone who can teach me in this area, because it's very important for my research study. Thank you in advance Yours truly, Nelly
  24. So, to give some background information, I have 0 experience with LISP programming, and am an intern at an engineering company. I really would love to score "brownie points" by automating an extremely boring and time consuming task. I have experience with other languages, and can work off of a good base. So here's what I would like the routine to accomplish: 1.) Figure out the name of the title block (the title block will be in the same location on each and every file) 2.) Use that name to modify 5 attribute values of that block (each title block has the same attribute tags: NAME, DRAWING_NUM, SN, DATE, DESIGNER) 3.) Save in a new location. So, for example, lets say the drawing I want to modify is at the location C:/USER/ME/, and is called drawing1.dwg. Lets say that it's title block is called "blanksheet", the routine then needs to modify the 5 attributes (NAME: DrawingName, DRAWING_NUM: 123456, SN: 000, DATE: 10 10 12, DESIGNER: Me) of the block "blanksheet". Then, after it modifies everything, saves it in the location C:/USER/YOU, and is called drawing2.dwg. I'm not even sure if this is doable within the bounds of AutoLISP, so any feedback is appreciated. Thanks in advance!
  25. josvandoorn

    Interested?

    Dear People, CADTutor has got a name in the AutoCAD community. I was at your web site. I saw your forum. I'm a mem ber of your forum.. You also have a forum that is dealing witgh AutoLISP, Visual LISP & DCL. I did not see AutoLISP programs there. But. I'm wondering. Are you interested in AutoLISP programs? Do you want to publish them? I have written many AutoLISP programs. I'm still writing AutoLISP programs. What is more. I'm writing articles about my AutoLISP programs. I publish them on my blog. If you want to see what I have got. Here is the website of my blog. http://www.speedupautocad.blogspot.com/ If you are interested, let me know. I could send you my articles. Let me know where I can send them to. And what format you want: DOC or text. Jos van Doorn SpeedUpAutoCAD
×
×
  • Create New...