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. Hello everyone. I've been looking at this old thread: http://www.cadtutor.net/forum/showthread.php?5953-lines-perpendicular-to-spline I need to use that code, but i can't seem to be able to do it, because of all the "&@40;" stuff (from what i can tell at least). Can someone re-make that last code from post #8, in a form so i can copy it, because I am less than a newbie in lisp. Thank you in advance.
  2. I started developing a lisp that will check all the polylines in a drawing for either the x or the y coordinate to be equal and change the color of each polyline that does not meet the criteria to red from "bylayer". I am having trouble with looping through each object sequentially and also the loop comparison of each vertex within the current object. Where I am trying to get to again is to check that all polylines within an architectural type of drawing are square and to alert which ones are not. I'm not a lisp expert so bear with me. If you want to correct my syntax great, or tutor me on what I'm doing so dreadfully wrong--even better. Thanks, Randy (first post) The code so far: (defun C:perp() (defun A1() (setq eFilter(list (cons 0 "polyline"))); entity names into a list (ssget "X" eFilter) ); ends defun A1 (defun B1() (setq eLen(length eList)); gets length of list ); ends defun b1 (defun D1() (setq Lwn 0); variable initial definition (setq e 0); ditto (repeat eLen ; repeat for length of entity list (setq e1(car (nth n e))) (if (= e1 10) (progn (terpri) (princ (cdr(nth n e))) ); closes progn ); closes if (setq Lwn (+ 1 Lwn)) (setq a (cdr (nth n e))) ); closes repeat ); closes D1 (defun Esub() (trace Esub) (setq coordLen(length e1)) ); closes Esub (repeat coordLen; repeat for length of coordinate list (defun G1() ;parse coordinates into xa ya xb yb (setq a (cdr (nth coordLen e))) (setq b (cdr (nth (+ coordLen 1) (+ e 1)))) ) ; ends G1 ;---------------BEGIN SUBROUTINE H1---------------------- (defun H1() (setq xa(car a)) (setq ya(cadr a)) (setq xb(car b)) (setq yb(cadr b)) ); closes H1 (defun H2() (= 0 (- xa xb)) (= 0 (- ya yb)) (T (Command "chprop" "p" "" "c" "red" "")) ); closes h2 ); closes repeat )
  3. Is there a command or Lisp routine that creates a 3dbox which sides are adjacent to a drawing? Something like a 3d boundary-space that contains everything you might have created..
  4. A jolly hello to all: I'm getting annoyed with myself; sometimes I forget to change my current layer setting, and end up placing drawing elements on incorrect layers. SO....I want to have a LISP that forces me to enter a layer name whenever I use (for example) the LINE command; I would start the command, then ACAD would bring up a prompt that asks me for a layer name. (i don't plan on physically entering the layer name everytime, I have a small programmable keyboard I will set up for entering layer names with one-button-push). This whole thing may sound silly, but I've only got about 6 layers to work with so it's not as laborious it may sound. Can someone help me out here? Thanks!
  5. I have been fighting with this for some time now: In a drawing that containes blocks with attributes, blocks with blocks with attributes AND xrefs with blocks with attributes. I need to extract some attributetags AND the X, Y and Z-coordinate. With ATTEXT and a filterfile I have got it working, BUT... Sometimes the ATTEXT-file that is created displays some strange values in the coordinates. Sometimes numbers are very small or very large, but the XREF-drawing shows no entities on that coordinates. For example 3.277566e-99 of 4.19987e125. These numbers cannot be transferred and used for the rest of the program. How can I fix this so it reads the real coordinates from the XREF/block and not some strange 'mutant'-code???
  6. Does anyone know if it is possible to use LISP, or VBA, or any sort of macros to add, or change custom properties within sheet sets?
  7. Hello everyone. I'm hoping one of you LISP geniuses can help me out. I dont know a whole lot about Lisp, but I think my question would be pretty simple for someone with a good LISP knowledge to figure out quite fast. I have attached a LISP and a DCL. Everything is working properly on it except for one thing. There are two checkboxes on the right of the dialogue box, one says EOL, and the other says Amber CKT. What I would like the lisp to do is, when one of the check boxes is checked, to add a fixed suffix onto the text string that the program is already building. They need to add these suffixes: EOL - "(EOL)" Amber - "A" Like I said, I think this would be pretty easy for somone who has experience writing LISP. If anyone can help me out I would greatly appreciate it! map.zip
  8. Hi all, As everyone has been more than helpful in previous posts I thought I'd ask if anyone knew if the following was possible. As a result of onsite coding my data input to CAD is pt number, elevation text, site notes and where appropriate blocks. With the tree blocks I manually scale the crown and trunk via dynmaic block manipulation as below. I wondered if scaling the crown and trunk elements was possible with a lisp routine? Any thoughts how I might go about this would be welcomed. Kind regards as always. Lownote1980
  9. Currently I use a lisp file to import page setup information, which brings in previously configured plot set up information (as found in a specified drawing template). page_setups.lsp... (DEFUN C:PSN () (command "._-PSETUPIN" "W:/Library/Acad Setup/Page_Setup_Template/page_setup_template.dwg" "*")) Although I have "page_setups.lsp" identified in my startup suite of applications to load, I still have to type "PSN" to import page setup info. Typing these three letters is tiring my fingers out. Can I build the import instruction into accaddoc.lsp so that I don't have to keep typing PSN, so that it autoloads (and imports) with every session / drawing?? Cheeeeeeeeeers, hosannabizarre
  10. I have a lisp that is supposed to create a Polyline box around selected text, trim lines within the box, and then delete the box. I am, however, having some issues getting it to run properly. Everytime I run it, I select the text that I want to use, but I get an error Select Text; error: bad DXF group: (-1 (13.3618 5.59898 0.0)) I am hoping that someone can help me out with this. ;;; This lisp routine creates a box around selected text, trims all entities within the box, and then deletes the box. (defun C:TTR (/ TEXTENT TRIMFACT TB GAP FGAP LL UR PTB1 PTB2 PTB3 PTB4 PTF1 PTF2 PTF3 PTF4 BX) (setq TEXTENT (entsel "\nSelect Text")) (setq TRIMFACT 2.0) ;Set trim gap and text height ratio HERE (command "ucs" "Entity" TEXTENT) (setq TB (textbox (list (cons -1 TEXTENT))) LL (car TB) UR (cadr TB) ) (setq GAP (* *TXTH TRIMFACT)) (setq FGAP (* GAP 0.5)) (setq PTB1 (list (- (car LL) GAP) (- (cadr LL) GAP)) PTB3 (list (+ (car UR) GAP) (+ (cadr UR) GAP)) PTB2 (list (car PTB3) (cadr PTB1)) PTB4 (list (car PTB1) (cadr PTB3)) PTF1 (list (- (car LL) FGAP) (- (cadr LL) FGAP)) PTF3 (list (+ (car UR) FGAP) (+ (cadr UR) FGAP)) PTF2 (list (car PTF3) (cadr PTF1)) PTF4 (list (car PTF1) (cadr PTF3)) ) (command "pline" PTB1 PTB2 PTB3 PTB4 "c") (setq BX (entlast)) (command "trim" BX "" "f" PTF1 PTF3 PTF4 PTF1 "" "") (entdel BX) (redraw TEXTENT) (command "ucs" "p") (princ) ) ;end trimbox (princ "\nType TTR to start") (princ); end TEXT TRIM.lsp Thank you in advance for your help
  11. Hi all, I've never written a LISP routine before and I am finding myself in need of a function that I can't seem to be able to do without LISP, so I have begun my first attempt. It's not going so well. I need to be able to pick two points and have a square drawn that uses those two points as opposite corners. I think if I can check the angle between the two points, then add or subtract 45-degrees from that, I will get the rotation for the square, and I can then use the RECTANGLE command to draw it by picking the first point, setting the rotation, and then pick the second point. I think the code should look something like this: (defun C:square (/p1 rot p2) (set q p1 (getpoint "\n Pick first corner:")) (set q p2 (getpoint "\n Pick opposite corner:")) (set q rotang (-45 (ANGLE p1 p2))) (command "RECTANGLE" p1 "R" " rotang "" p2) (princ) ) The first problem I run into is that I don't know how to check the angle between the two points. I know I can get it by using the DIST command and the value comes up as "Angle in XY-plane" but I don't know how to then use that value as my ANGLE value. Second, I have no idea if I am even on the right track as far as writing the code. Any help would be greatly appreciated. I'm working in Civil 3D 2011.
  12. Hi everyone! I'm kinda new in this LISP world and I'm having some trouble on this project of mine. Here we go: I need a LISP to draw a PLINE and create a text with the PLINE's area. The area is always different and I don't have the points to draw the PLINE, so I have to draw it with the mouse and when I finish I want to have the area value in a text placed inside that PLINE (I can place it with a mouse click, but I don't want to have to write the area). This is the code I already wrote: I would appreciate any help! Thanks!
×
×
  • Create New...