Jump to content

Search the Community

Showing results for tags 'lisp'.

  • 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. I'm trying to write a routine to draw a style of cover that we use regularly, but I'm having trouble getting past the math functions in lisp. I should clarify that I don't have a clue on .lsp programing; so any help must take that into consideration to save both of us a lot of headaches. Here is what I have so far: (defun c:SBC () (defun dtr (deg) (* deg (/ pi 180)) ) (setvar "cmdecho" 0) ; Data Input (prompt "\nENTER ALL DIMENSIONS IN DECIMALS ") (setq mthk (getreal "\nEnter Material Thickness: ")) (setq ikr (getreal "\nEnter Cover I/S Knuckle Radius: ")) (setq csf (getreal "\nEnter Cover Straight Flange: ")) (setq covrad (getreal "\nEnter Cover I/S Radius: ")) (setq covlng (getreal "\Enter Cover I/S Length: ")) (prompt "\nEnter Lip I/S Dimension: : ")) (if (= lip nil) (setq lip 0.4375)) (prompt "\nEnter Hinge I/S Width: : ")) (if (= hw nil) (setq hw 1.0)) (setq hdp (getreal "\nEnter Hinge I/S Depth: ")) ; Calculations ;Inside Bend Radius (setq isbr (/ mthk 2)) ;Included Bend Angle at Lip (setq iba1 (dtr 90)) ;Centerline Bend Radius (setq cbr1 (= mthk)) ;Centerline Arc Length at Lip (setq cal1 ((* cbr1 2 pi iba1) / 360))) ;Centerline Arc Length/2 at Lip (setq hafcal1 (cal1 / 2)) ;Centerline Bend Radius at Flange (setq cbr2 ((mthk / 2) + ikr) ;Included Bend Angle at Flange (setq iba2 (angle 90)) ;Centerline Arc Length at Flange (setq cal2 (cbr2 * 2 * pi * iba2 / 360)) ;Circle Blank Radius (setq cirbr (covrad - ikr + cal2 + csf)) )
  2. hi i have a lisp that dose not attach the hyperliks to the block on first run it dos on the 2nd run evan after i deleat the blooks to start agen. the issue sems to be in the hyperlink comand and it is not finding the block at the location some help world be great:P (-hyperlink Enter an option [Remove/Insert] : i Enter hyperlink insert option [Area/Object] : o Select objects: 25722.21,65506.921,625.235 0 found Select objects: Error in selection.) my code (defun C:lmg() ;;;;;; READING CSV ;;;;;;;;;;;;;;; (setq gf (getfiled "Select CSV File" "" "csv" 16)) ;slect file (setq f (open gf "r")) ;open file for reading (while (setq row1 (read-line f)) ;reads next line of csv (foreach line data ;do to each line (princ "\n " )(prin1 line)"") ;grab next line ? ;;;;;; PONT ;;;;;;;;;;;;;;;;;;;;;;;; (setq pont1 (vl-string-position (ascii ",") row1 nil )) ;finds first (,) (print pont1) (setq pont2 (substr row1 pont1)) ;grabs evrythink in from first (,) to end (print pont2) (setq pont3 (substr pont2 3)) ;pont shift fix (print pont3) ;prints results ;;;;;; EASTING,NORTHING,HIGHT ;;;;;; (setq enz1 (vl-string-position (ascii ",") pont3 nil T)) ;finds last (,) (print enz1) (setq enz2 (substr pont3 1 enz1)) ;grabs evrythink in from last(,) to start (print enz2) ;prints results ;;;;;; PHOTO FILE ;;;;;;;;;;;;;;;;;; (setq file1 (vl-string-position (ascii ",") pont3 nil T)) ;finds last (,) (print file1) (setq file2 (substr pont3 file1)) ;grabs evrythink in from last (,) to end (print file2) (setq file3 (substr file2 3)) ;pont shift fix (print file3) ;prints results (setq file4 "photos/") ;set's "photos/" as a string (setq file5 (strcat file4""file3)) ;combinds string (file 4 & 3) (print file5) ;prints results (princ "\n") ;go to next line ;;;;;; HYPERLINK ;;;;;;;;;;;;;;;;;;; (COMMAND "_insert" "Photo Node" (strcat enz2) "1" "1" "0") ;inserts photo node (princ "\n") (command "regenall") ;go to next line (COMMAND "-hyperlink" "i" "o" (strcat enz2"") "" (strcat file5"") "" (strcat file3"")) ;add's hyperlinks photos ) ;close while (princ) ) ;close defun Book2.csv
  3. calafragilistic

    "Arc"-like Leader

    When I used to use R14, I had a customized leader command where the first click was the endpoint of a leader (as usual), the second click was like the midpoint of an arc, and the third click was the other endpoint of an arc. You could continuously keep clicking and producing more arcs connected to the leader block, but typically I would just end the leader there, and it would not end with a text attached to it. Since I upgraded to AutoCAD 2010, the LISP function that I used for that did not transfer over, but I would like to have that again, as the spline leaders that are standard in 2010 look terrible compared to what I used to have, and are nowhere near as versatile. Is there a place I can find a LSP command to do the same thing, or will I have to rewrite the new command again? Here are some examples of how the finished 'CLeader' looked:
  4. Hi all, I'm familiar with the pedit command to turn a spline into a polyline, but I'm wondering if there's a way to change all Splines to Polylines automatically to save a hell of a lot of time. I've tried loading "Spline-to-Pline" LISP file, It's pretty shocking for keeping a reasonable tolerance and resolution at the same time as I need a line/arc length of at least .3mm for our CNC laser cutter.. Any thoughts? (See attached ACAD file with Splines I'm converting) Cave AUTOTRACE.dxf
  5. Hi, hello everyone. i am new to autolisp. i need a routine that can calculate distance between two points and write it down to active cell of active workbook. (wherever selected in excel). Is it possible? will be very helpful to me. Thanks
  6. Hi, I would like to know: are there any lisp that can calculate the DIP and the length of a 3d Polyline, in Front View or any other view?
  7. Hi Everyone, I've been lurking here for over a year now and have found lots of useful information (thanks!), but I've finally done something that doesn't seem to have been solved before, and that there may be no easy answer to. We use a complicated system of layer states, views, and freezing and unfreezing layers to set up different print states to create a package of drawings. It is sort of a wacky use of AutoCAD, but this is due to the necessity of showing an opera as it progresses through time (Act 1, Act 2, etc.). We have hundreds of operas in our repertory and this won't be changing anytime soon. Anyway, as it stands now, there is a .txt file that lives in the same directory as the file containing the scenery that is manually created so that print scripts can work. I am attempting to turn that .txt file into something that lives in a dialog box for ease of use and cleanliness. The data will be stored in a mulitline attribute in a block. I've spent a fair amount of time creating a dialog box that changes size dynamically, allows for reordering of printouts and having multiple scenery layers appear on the same printout. My only real issue (which is of course a big one) is that if you add too many rows, the dialog box becomes too big to fit on the screen. What I would love to be able to do is to make the whole box (except the buttons at the bottom) scroll up and down so that the height of the dialog box is fixed to the smallest screen we use here (~800 pixels). I've spent a little time with OpenDCL but find it a bit byzantine, and I don't know any .NET or VBA so either of those solutions will involve me learning some new programming languages--not necessarily a deal breaker but not ideal either. I'm attaching a .dwg with the attributed block and the .lsp file for anyone who wants to take a look. The command c:met_plot_2015 will create and open the dialog box, which you can then manipulate. I appreciate anyone who read to the end of this post, and any help you can provide. Thanks, Eric P.S. The printing function doesn't actually work yet; that's next on the list once I solve this. specialblock.dwg BETTERPRINTING 5.LSP
  8. Morning All, Is the a lisp or some code to delete a hatch from every block in a drawing. The super market chain I'm working with use the same blocks over and over on different projects but there is a hatch on most of the blocks which interferes with my phasing drawings. I've tried Freezing/Turning Off the layer but as they have not set the blocks up with layer intelligence that doesn't work. I'm not worried about loosing the information contained within there blocks as I'm working for the builder producing CAD files that are only issued in PDF format. I don't want to explode the blocks! Look forward to your comments
  9. Hi there, I am using this lisp to remove binding Prefix from dimstyle name and textstyle name as well. After removing prefix some style names are matching existing names and that cancelling the renaming process. I need someone to modify this lisp (I don't know the developer name) to merge the style if its name after removing prefix will be typically matching other name of an existing style. Please help ! I googled this issue hundreds of times and i didn't find ! (defun c:RBP(/ ActDoc Name NewName) (vl-load-com) (defun RemoveBindPrefix (String / Pos LastPos) (if (setq Pos (vl-string-search "$" String)) (progn (setq LastPos Pos) (while (setq Pos (vl-string-search "$" String (1+ Pos))) (setq LastPos Pos) ) (substr String (+ 2 LastPos)) ) String ) ) (vlax-for Obj (vla-get-TextStyles ActDoc) (setq Name (vla-get-Name Obj)) (if (/= (setq NewName (RemoveBindPrefix Name)) Name) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Name (list Obj NewName))) (prompt (strcat "\n Text style: " Name " was not renamed.")) ) ) ) (vlax-for Obj (vla-get-DimStyles ActDoc) (setq Name (vla-get-Name Obj)) (if (/= (setq NewName (RemoveBindPrefix Name)) Name) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Name (list Obj NewName))) (prompt (strcat "\n Dimension style: " Name " was not renamed.")) ) ) ) (princ) )
  10. Does anyone know of a field expression or lisp routine that will allow me to display a count of the number of polylines on any specified layer? I would like the number displayed to be able to update as I add polylines to the layer, just as an area field expression would update on regen. Thanks very much
  11. Hi i want to replace the _open command this works on my old PC but when i go to install on another it just run the default open is there some variable that stops defun from redefining standard autocad commands ; variables set (setq tilemodevar (getvar "tilemode")) (setq varCPROFILE (getvar "CPROFILE")) ; close windows (COMMAND "EXTERNALREFERENCESCLOSE") (COMMAND "LAYERCLOSE") (COMMAND "PROPERTIESCLOSE") (COMMAND "ADCCLOSE") ; Open drawing from vault (if (= varCPROFILE "Vault_r2014_Acad") (progn (defun c:_open () (command "_vltopen" "" ) ;_ end of command );_ end of defun ) ;_ end of progn ) ; autocad variables unset (setvar "FILEDIA" FILEDIAvar)
  12. hi, I have a little problem with a lisp file that extract coordinates from DWG and label them with prefix and counters then export them to text file. if anybody can advice how to exit this lisp correctly i would really appreciate it a lot. (defun run () (setq pll (getstring "\nPlease Enter of new file (name.ext) :")) (setq pl (open pll "w")) (setq ang ( getreal "\nPlease Enter DV Angle: " ) ) (setq n ( getstring "\nPlease Enter TAXI name: " ) ) (initget (+ 1 2 4)) (setq a ( getint "\nPlease Enter MH number: " ) ) ;(setq e (getstring "\nget no. of first Point :")) ;(setq a (atoi e)) (while (> a 0) (setq aa 1) (while (<= aa 4) (setq p (getpoint "\nselect point :")) (setq v1 (strcat "\n " (itoa a) " " (itoa aa) " ")) (setq d (polar p (dtr 90) 0)) (setq f (itoa aa)) (setq k (itoa a)) (setq g (strcat n "-" k "-P-" f)) (command "layer" "m" "number" "c" "3" "" "") (command "text" "m" d 0.2 ang g) (setq num (entlast)) ;(command "change" num "" "layer" "" number "") (command "change" num "" "p" "layer" "number" "") (command "layer" "m" "point" "c" "1" "" "") (command "point" p) (setq pt (entlast)) ;(command "change" pt "" layer "" point "") (command "change" pt "" "p" "layer" "point" "") (setq x (car p)) (setq x (rtos x 2 4)) (setq x (strcat x " ")) (setq v2 x) (setq y (cadr p)) (setq y (rtos y 2 4)) (setq y (strcat y " ")) (setq v3 y) (princ V1 pl) (princ v2 pl) (princ v3 pl) (setq aa (+ aa 1)) ) (setq a (+ a 1)) ) (command "layer" "m" "txt" "c" "5" "" "") (close pl) (redraw) (princ) ) (defun c:I () (run) (setq fil (getstring "\nget name of the file (name.ext) :")) (setq p1 (getpoint "select insertion point :")) (setq p2 (polar p1 0.0 35.0)) (setq p3 (polar p1 0.0 105.0)) (setq p4 (polar p1 (/ (* -1 pi) 2) 20.0)) (setq p5 (polar p4 0.0 35.0)) (setq p6 (polar p4 0.0 70.0)) (setq p7 (polar p4 0.0 105.0)) (setq p8 (polar p2 (/ (* -1 pi) 2) 10.0)) (setq p9 (polar p8 0.0 35.0)) (setq p10 (polar p8 0.0 70.0)) (setq p11 (polar p8 (* -1 pi) 15.0)) (setq p12 (polar p8 (/ pi 2) 5.0)) (setq p13 (polar p8 (/ (* -1 pi) 2) 5.0)) (setq p14 (polar p12 0.0 35.0)) (setq p15 (polar p13 0.0 17.5)) (setq p16 (polar p13 0.0 52.5)) (setq p1- (polar p1 (/ (* -1 pi) 2) 2000000000.0)) (command "text" "m" p11 3.0 0.0 "POINT NO.") (command "text" "m" p14 3.0 0.0 "COORDINATES") (command "text" "m" p15 3.0 0.0 "X") (command "text" "m" p16 3.0 0.0 "Y") (command "line" p1 p4 "") (setq L14 (entlast)) (command "line" p2 p8 p5 "") (setq L285 (entlast)) (command "line" p9 p6 "") (setq L96 (entlast)) (command "line" p3 p10 p7 "") (setq L3107 (entlast)) (command "line" p1 p2 p3 "") (command "line" p8 p9 p10 "") (command "pline" p4 p5 p6 p7 "") (setq L4567 (entlast)) (setq fill (open fil "r")) (read-line fill) (setq new ()) (setq j 0.0) (setq p44 p4) (while (setq S (read-line fill)) (setq pt (polar p44 (/ (* -1 pi) 2) (+ 5 j))) (setq pt1 (polar pt 0.0 12.5)) (setq pt2 (polar pt 0.0 50)) (setq pt3 (polar pt 0.0 85)) (setq t1 (substr S 1 4)) (setq t11 (strcat n t1)) (setq t2 (substr S 5 18)) (setq t3 (substr S 23 32)) (command "text" "m" pt1 3.0 0.0 t11) (command "text" "m" pt2 3.0 0.0 t2) (command "text" "m" pt3 3.0 0.0 t3) (setq p4 (polar p4 (/ (* -1 pi) 2) 10.0)) (setq p5 (polar p5 (/ (* -1 pi) 2) 10.0)) (setq p6 (polar p6 (/ (* -1 pi) 2) 10.0)) (setq p7 (polar p7 (/ (* -1 pi) 2) 10.0)) (command "offset" (+ j 10.0) (list L4567 p4) p1- "") (setq new (entlast)) (command "extend" new "" (list L14 P4) "") (command "extend" new "" (list L285 p5) "") (command "extend" new "" (list L96 p6) "") (command "extend" new "" (list L3107 p7) "") (setq j (+ j 10.0)) ) ;(close) (close fill) ) (defun dtr (x) ;define degrees to radians function (* pi ( / x 180.0)) ;divide the angle by 180 then ;multiply the result by the constant PI ) (princ)
  13. Hi. I want to create sections in a solid. These sections pass through planes xy which are incremented by a value to set (Z = 0.05 ... ), and the beginning and the end of the planes must be set too ( Z = 0 to Z = 123 ...). Regions generated would be converted to polylines (open at one end (N, S, E , W) ) shifted inward or outward 1x by an indicated value ( Offset = 3 ...). Each section as well created would be converted into block *.dxf appointed by the drawing name - value of the plan Z. This macro serve to generate a G-code (clean) almost directly usable by a CNC control software (with a post traitment with ACE converter). The interest to create different "block" is to have the choice to enter different block of programmation in the CNC software. Merci pour tout éventuel renseignement.
  14. I have this code: (setq PT1 (getpoint)) (setq PT2 (getpoint PT1)) (command "LINE" PT1 PT2) (command) (setq obj1 (entget (entlast))) (setq ent (car (nentsel "\nSelect Entity: \n"))) (cond ((/= ent nil) (setq obj2 (entget ent)) (command "chamfer" obj ent) ) ((= ent nil) (setq PT3 (getpoint ent)) (command "LINE" PT2 PT3) ) ) ) Its supposed to be able to draw a line when if there is no entity it draws the line up till that point where I tried to select the entity. However when I execute this code, it will state that I have an inappropriate data type. How should I modify the code to be able to draw the line from the last point to the point of which I tried to select an entity if an entity doesn't exist at that particular point?
  15. I want a lisp that when two lines are inserted and they intersect each other at 90 degrees, I want them to create a chamfer
  16. Hi, brand new to this site and my very first thread! I am trying to write a LISP routine and basically have no experience with it except for opening them up and trying to decode it for my self. I am going over lisp basics right now but thought I would through this out there in hopes of learning something from you fine folks. What I need to do is draw a series of circles and rectangles and label them from values in a .CSV file. As I mentioned I am going over the basics and am having trouble keeping my head above water, so be kind please. Thanks in advance, CADINATOR
  17. I have scoured the net for a way to select all objects within a selected closed polyline as well objects that are touching the polyline, which i have found, but i need to be able to select more than one closed polyline at a time ,as I work on thousand of circles (drill holes) and shapes at any given time a lot of the time. If someone could please help me it would be greatly greatly appreciated. I am hoping for a modified lisp file that has been out there already.
  18. I found this lisp from (http://autolispgs.blogspot.com/2013/02/create-new-layer.html), and I would like the new created layer to become the current layer. Ty (defun c:Newlayer (/ Layername Color) ;;Author:Ganesh Shetty, Copyright © 2013 -http://autolispgs.blogspot.in (setq Layername(getstring "\nEnter New Layer Name:")) (if (not (Tblsearch "LAYER" Layername)) (progn (setq color(getint "\nEnter Color Type for New Layer:")) (command "_Layer" "New" layername "c" color layername "") (princ(strcat "\nLayer \"" layername "\"Created .")) ) (princ "\nLayer Name Already exist.") ) (princ) );end defun
  19. 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#
  20. Hi Guys, Someone knows a Lisp used to replace a internal block(s) of a folder with dwg many files. Eg: The specific folder has a "n" files with A3 formats blocks using the same attributes and tags, so, if it's necessary do a correction in a little detail in this format, it's necessary to replace it, one by one on all of these files. Thanks in advance...
  21. Hi This is my first post in this awesome forum:). I’ m newbie in drafting Kindly help me with a lisp program. That Asks the user to select various texts in the drawing Places an attribute text over the selected text without replacing them Makes an attribute block with that att texts The values of the att block should contain the texts Note: the tag name should be following a number system (If I have selected 3 texts then the tag names can be antas1,antas2,antas3 or yourname1,yourname2,yourname3:P) Please help me. Daily I have to spend one hell of time in this work:cry: .
  22. Guys, I need one help, someone knows one Lisp that I can get Texts (words) on AutoCad and export it in order of selection to a cell on Excel... Eg.: If I have 10 words, as I'll selecting it and when finished these then words will be exported to a cell (could be cels) to Excel. Thanks in advance...
  23. Hi, I need a lisp to convert polyline to the cloud as per image below. Hope someone can help me. :)
  24. We are looking for custom autocad lisp or autocad plugin or something. Our work routine is: 1/ place objects in autocad (one object = block +another block + hatch + leader) 2/ export list of numbers taken from leader value 3/ add data to list in excel 4/ edit in the same data in autocad representing data that is in excel (scale for blocks, color for hatch) // this is the part we would like to automate.
  25. Hello Guys, I wish to all a good new year!!!... I was looking to any Lisp to help doing a Cable Interconnection Address Link, working with a interconnection drawing to electrical system we have to link one cable from one page (eg. sheet 1) to another (eg. sheet 2) on the same dwg file (in other cases in diferente dwg files - one sheet by file drawing). Someone knows some lisp that can do a sheet and a item address link as the file attached? Automatically, selecting the first point to link with the second point, presenting on the first point the end address (sheet and item), on the other side the source (sheet and item)? Thanks in advance!!!... * Item is a order of item on the specific source sheet (without repeat).
×
×
  • Create New...