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, I'm building a lisp to add new text based on a standard distance givven by the user. The lisp is: (defun c:myFunction() (setq point (getpoint "Click on start point :")) (setq qtd (getint "\nQuantity of blocks :")) (setq dist (getint "\nDistance :")) (setq x 0 y 0 q 0) (setq pp point) (setq x (car pp)) (while (< q qtd) (setq Text (getstring "Text :")) (command "text" pp "2" "0" Text ) (setq x (+ pp dist)) (setq q (+ q 1)) ) ) But when it asks the Text to be entered, I type it but the following error shows up. error: bad argument type (+ PP DIST) (SETQ X (+ PP DIST)) I think its the type of dist and pp, because one is getint and other is getpoint.
  2. I'm a student. I am learning about LISP routines. What I'm trying to do is write a lsp that has the user key in point (using createpointmanual I'm assuming) and then draw a polyline from one point to the next. So far my program should to do this: - prompts user to key in point(s) - draws a polyline that connects the points I'm guessing I have to make a list for the points and keep adding to the list as each point is created. Can I use a counter, let say p1 (point 1) then p2 p3 p4 and so on, and then add it to the list? Example: (setq aa (list p1)) (setq aa (append aa p2)) *I know I have to keep adding to this list. I think I'm just confusing myself Anyone got any resources or ideas or answers on what code I need to write?
  3. I have over a thousand block reference points that I have imported into AutoCAD. I would like to convert these block reference "crosshairs" into circles. I want the diameter of these circles to correspond with the elevation numbers from the data set. If you're wondering why I want this, I am trying to make a map of trees in a plot and the diameter is one of the crucial bits of information I want displayed for every tree. Inputing the data in PENZD style limits the amount of information displayed and, since I only need a 2D map, the elevation represents the diameters. I have a lisp code for converting points to circles but I haven't found a way to convert block reference data to circles. If anyone could write that code or instruct me on how this can be accomplished, I would greatly appreciate it. Thanks!
  4. So new to LISP it's ridiculous, and I need help. I'm doing some designs for lighting and sound, and I have sets of blocks at various points around a floorplan. I plan on making these blocks (dynamic blocks if necessary) and giving them similar nomenclature according to what they are (speakers, monitors, motors, trusses, etc.). Now, rather than going through and measuring the distance by hand, so to speak, for every single item, I'd love to find a LISP routine where I can insert a custom (like 200, 0) insertion point to measure from, and measure each (or batch) block's distance from that point. If the results could be posted in a table, that would be even more awesome. Presumably I would use the names of the similar blocks, as in, any block with the word "motor" in its tag or name. I sense I am asking for something rather big here...
  5. Hi, I'm new to writing LISP's and have finnished a couple for my studio. Just to keep busy when tides are low. The last I'm almost done with is an offset lisp that offsets in sequence (I do't really care if there are lisps already made for this, I've been trying to practice on my lisp routine making). I first choose the number of offsets, then the value for each offset and finally the side to offset. My problem is that when I zoom in close to the line the lisp works great - I mean, it offsets to the valeus I inputed. But when I'm a bit far out on the zoom it offsets to different values. I really don't know why it is doing this. Do I need to adjust the zoom sesitivity or something? Is there such a thing? Here is the code I wrote (it's in portuguese). Don't mind the messy way it's wirten. Thanks ;Criado por Rodrigo Líbano (defun c:offseq (/ numof numof2 numof3 list carl carls carlss voffx vof2x vof1x p2x side) (initget 7) (setq numof (getint "\nNúmero de offsets [2 ou mais]:")) (initget 7) (setq voffx (getdist "\nValor do primeiro offset:")) (setq numof (- numof 1)) (setq numof2 numof) (setq numof3 numof) (setq list (cons voffx voffx)) (setq vof1x voffx) (while numof (initget 7) (setq vof2x (getdist (strcat "\nValor do próximo offset [Restam:" (rtos numof 2 0)"]:"))) (setq vof2x (+ vof2x vof1x)) (setq list (cons vof2x list)) (setq vof1x vof2x) (setq numof (1- numof)) (if (= numof 0) (setq numof nil) (setq numof numof) ) ); end while (princ list) (setq carlss carls) (while (setq p2x (cadr (entsel "\nSelecione Objeto:"))) (setq side (getpoint "\nSelecione lado:")) (while numof2 (setq carl (nth numof2 list)) (if (= numof2 numof3) (setq carls (- carl carl)) (setq carls (nth (+ numof2 1) list)) ); end if (setq carls (- carl carls)) (setvar "OFFSETDIST" carl) (command "._UNDO" "_GROUP") (command ".OFFSET" carl p2x side "") (if (= numof2 0) (setq numof2 nil) (setq numof2 (- numof2 1)) ); end if ); end while (setq numof2 numof3) (setq carl carlss) ); end while (princ) )
  6. Post Moved for Lisp Forum: here is the Link I'm creating a function for talude. But, on the line: command "chprop" ULT "" "LT" "" "autotalude1" "") it doesnt recognizes the command. can anyone tell me why? Here is the part of the code where I invert the propertie: (setq ULT (entlast)) (command "pedit" ult "spline" "") (setvar "celtype" "autotalude2") (initget 1 "S N") (setq inv (getkword "\nWant to Invert?<S/N>")) (if (= inv "S") (command "chprop" ULT "" "LT" "" "autotalude1" "") (setvar "celtype" "autotalude1") ;(command "pedit" ULT "r" "" "yes" "" "s" "") ;(command "pedit" ult "S" "") )
  7. KennethYeoh

    Lisp Newbie

    I was just following the tutorial and i realised that i could not load the testline lisp. AutoCad states [; error:too many arguments ]? I have tried everythin i could think of to no avail. It would be very helpful if someone could shine some light on this issue. Regards Kenneth
  8. CADalyst

    Value Changer

    I am new to this forum and LISP programming so please bear with my lack of knowledge. I have a couple of hundred blocks which I'm interested in changing the values of specific tags using lisp (or something else). I have lots of different blocks, and they all have two attributes. The tag for attribute 1 is "X", with a value of "100" The tag for attribute 2 is "Y", with a value of "200" Is is possible to change all the blocks in the drawing, such that the attribute 1 value is renamed from "100" to "1", and the attribute 2 value is renamed from "200" to "2". I would like, if possible, to preserve and leave unchanged the tags associated with the respective attributes, and change only the value. So basically, once the script is done, I will still have the blocks with the same attributes, just different tag values. To clarify; I'm interested in replacing attribute values rather than changing attribute tag names. I hope this makes sense and that it is possible. Many Thanks
  9. Already, another challenge for experts from LIPS: In working with various entities overlaid with different colors and layers, you can get a selection of colors of visible entities in the upper layer, ignoring the entities of the same color located in a lower draw order?
  10. Hi, I am looking to lock multiple layers simultaneously by selection window. Or by clicking multiple times. The inbuilt lock layer (_laylck) command does not seem to support selection windows and only does one layer at a time. I would like to do mutiples. I am fairly new to LISP but fairly good at script writing (been on LT for several year, now on full!!!) I found this script on the forum; type "frz" to run lisp (defun c:frz () (setvar "cmdecho" 0) (setq data (enget (car (entsel))))) (setq laynme assoc 8 data)) (setq lay (cdr laynme)) (command "layer" "freeze" lay "") (princ)) Though autocad (2011) throws out an error (see below) Any suggestions on how to modify the above a) to work and b) to do what i want? Or is there a better way? Thanks for your help!
  11. Hello everybody! I have a dynamic block with several look-up values for the polylines width and I'd like to label them (as a text in the drawing over the block), and be able to move this label where best fits. I've being trying inside the block, but then it can't be moved outside of it. I tried MText with field outside the block, but it has to be applied in many one by one. I was wondering if someone can help me on this. Should I use the block itself (how?) or there is a lisp for this? I have a lisp for bearing and distance for lines, which places the bearing text above them and the distance text below those lines, no matter what angle is. It will place in the middle and in the same angle as the line. I edited this lisp file, but I have no idea how to change it for my purpose, as I don't understanding all the codes inside of it. Thank you so much! I'd appreciate someone's help!
  12. Ok. So I'm using a lisp routine that has been previously set up. It wouldn't display any of the current UCS coordinates. I think I fixed that. But now, I have caused a problem with the leaders. Specifically the line that is supposed to go underneath the N but above the easting. In WCS it works out just fine, but in the UCS it shoots off up and right. usually based on how far I am from the World Origin. Help! Below is the code. (Sadly I don't know exactly where the problem is) Main Function--------------------------------------------------------------------------- ;;;Function draws a leader with no text. (defun bmcdNE (wLeader wElev wa / ap np ep N E) (BMCDTextStyles) ;load standard text styles (BMCDDimStyles) ;load standard dim styles ;save variables (NEsave-vars) ; setup error handler here (setvar "cmdecho" 0) (setq *error* leader-error) ;check and set dscale (if (= dscale nil) (setq dscale (getvar "dimscale")) );end if (QlSave);saves current settings ;Now we need to set the current settings for the needed leader (setq NoText '(4 ;1. AnnoType 60 0Mtext<def> 1Copy 2Tolerance 3BlockReference 4None 0 ;2. ReuseAnno 61 0None<def> 1Next 2Current 1 ;3. LeftAttach 62 0TopOfTop 1MiddleOfTop<def> 2Middle 3MiddleOfBottom 4BottomOfBottom 3 ;4. RightAttach 63 0TopOfTop 1MiddleOfTop 2Middle 3MiddleOfBottom<def> 4BottomOfBottom 0 ;5. Underline 64 1On 0Off<def> 0 ;6. Splined 65 1On 0Off<def> 1 ;7. NoPointLimit 66 1On 0Off<def> 2 ;8. NumPoints 67 Integer (Must be greater than 2) 3<def> 0 ;9. Wordwrap 68 1On<def> 0Off 1 ;10. AlwaysLeftJust 69 1On 0Off<def> 0 ;11. Angle1 70 0Any<def> 1Horizontal 2?d 3Ed 40d 5 d 0 ;12. Angle2 71 0Any<def> 1Horizontal 2?d 3Ed 40d 5 d 0 ;13. Box 72 1On 0Off<def> 0.0 ;14. Textwidth 40 Real (Must be > 0.0) 0.0<def> "." ;15. Arrowname 3 String (or User defined arrow as block name) See definitions below ));end setq (command "osnap" "end,mid,intersection,center") (SetQleader NoText) (setvar "dimlwd" -1) (setvar "texteval" 1) (setvar "orthomode" 0) (setq style (cdr(assoc 40 (tblsearch "style" (getvar "textstyle"))))) ;gets the text height from style. (setq comp (cdr(assoc 41 (tblsearch "style" (getvar "textstyle"))))) ;stores the compression factor. (if (= 0 style) (setq ts (getvar "textsize"))) ;sets the text size to the active textsize. (if (/= 0 style) (setq ts style)) ;sets the text size to the style size. (command "layer" "set" "G-ANNO-TEXT" "") (setq pt1 (getpoint "\nEnter starting point:")) ;Gets the first point for the ;coordinate and line. (setvar "osmode" 0) (setvar "luprec" 2) (setq save-pt1 pt1) ;;; ;do we need to covert the point from pspace to mspace? (if (= (getvar "tilemode") 0) (setq cs_from 0) ;WCS (setq cs_to 1) ;UCS (setq pt1 (trans pt cs_from cs_to 0) ; disp = 0 indicateds that pt is a point ) (setq x1 (car pt1)) ;Stores the x coord of the first point. (setq y1 (cadr pt1)) ;Stores the y coord of the first point. (setq z1 (caddr pt1)) ;stores the z coord of the first point. JAH (setq xabs (abs x1)) ;Gets the absolute value of the x point. (setq yabs (abs y1)) ;Gets the absolute value of the y point. (setq zabs (abs z1)) ;Gets the absolute value of the z point. AMS (setq x (rtos xabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the x coord from real to string. (setq y (rtos yabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the y coord form real to string. (setq z (rtos zabs (getvar "lunits") (+(getvar "luprec")0))) ;Converts the z coord form real to string. JAH ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr x (+(vl-string-search "." x) 2))) (getvar "luprec")) (setq x (strcat x "0")) ) ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr y (+(vl-string-search "." y) 2))) (getvar "luprec")) (setq y (strcat y "0")) ) ;if the number of decimal places is less than the precission add zeros (while (< (strlen (substr z (+(vl-string-search "." z) 2))) (getvar "luprec")) (setq z (strcat z "0")) ) (setq IN x) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq x OUT) ;Saves variable from subroutine. (setq IN y) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq y OUT) ;Saves variable from subroutine. (setq IN z) ;Sets variable for subroutine. (COMMA) ;CALLS SUBROUTINE. (setq z OUT) ;Saves variable from subroutine. (setq pt1 save-pt1 ) (if (> X1 0) (setq E (strcat "E " x )) ;Checks to see if X coordinate ) (if(< X1 0) (setq E (strcat "W " x )) ;is positive or negitive ) (if(= X1 0) (setq E (strcat "BASELINE " x )) ;and sets the proper label. ) (if(> Y1 0) (setq N (strcat "N " y )) ;Checks to see if Y coordinate ) (if(< Y1 0) (setq N (strcat "S " y )) ;is positive or negitive ) (if(= Y1 0) (setq N (strcat "BASELINE " y )) ;and sets the proper label. ) (setq ABC "ABC ") ;;;build the elevation label (setq Zelev (strcat "EL " z)) (setq nl (strlen N)) ;Gets the string length of the N variable. (setq el (strlen E)) ;Gets the string length of the E variable. (cond ((> nl el) (setq ll nl)) ;Tests to see if the N var is longer than ;the E var. ((> el nl) (setq ll el)) ;Tests to see if the E var is longer than ;the N var. ((= nl el) (setq ll nl)) ;Tests to see if the N and E var are equil. ) ;end cond (setq pt2 (getpoint pt1 "\nEnter second point:")) ;The pt1 is used to create ;a rubberband line. (grdraw pt1 pt2 -1) ;Draws a tempory line to let you see ;where you are and what is going on. (setq x2 (car pt2)) ;Stores the Second X point (setq y2 (cadr pt2)) ;Stores the Second Y point (setq pt3 (getpoint pt2 "Enter side to offset:")) ;The pt2 is used to create ;a rubberband line. (setq x3 (car pt3)) ;Stores the Third X point (setq y3 (cadr pt3)) ;Stores the Third Y point (cond ((> x2 x3) (setq lx (- x2 (* 0.8 ts ll comp)))) ;Checks to see wich way ((> x3 x2) (setq lx (+ x2 (* 0.8 ts ll comp)))) ;you are drawing the line ) ;and sets the end of line ;to match the text length. (cond ((> x2 x3) (setq tx lx)) ;Based on the direction of the line ((> x3 x2) (setq tx (+ x2 ts))) ;the text X point is calculated. ) (setq ta (+ y2 (* ts 3))) (setq ap (list tx ta)) (setq tn (+ y2 ts)) ;Calculates the Y point for North or South text. (setq np (list tx tn)) ;Creates the point to place the text. (setq te (- y2 ts )) ;Calculates the Y point for East or West test. (setq ep (list tx te)) ;Creates the point to place the text. (setq tElev (- y2 (* ts 3))) ;Calculates the Y point for Elevation text. (setq elevP (list tx tElev)) ;Creates the point to place the text. (setq ly y2) ;Sets the last Y point EQ. to the second Y point. (setq pt4 (list lx ly)) ;Creates the point for the end of the line. (command "pline" pt2 pt4 "") ;Places the line. (setq theline (vlax-ename->vla-object (entlast))) ;get the line object (if (= style 0) (command "text" "J" "ML" np ts "0" N)) ;Places the top text. (if (/= style 0) (command "text" "J" "ML" np "0" N)) ;Places the top text. (setq toptext (vlax-ename->vla-object (entlast))) ;get the text object (if (= style 0) (command "text" "J" "ML" ep ts "0" E)) ;Places the bottom text. (if (/= style 0) (command "text" "J" "ML" ep "0" E)) ;Places the bottom text. (setq bottomtext (vlax-ename->vla-object (entlast))) ;get the text object (if wa (progn (if (= style 0) (command "text" "J" "ML" ap ts "0" ABC)) (if (/= style 0) (command "text" "J" "ML" ap "0" ABC)) (setq atext (vlax-ename->vla-object (entlast))) ) ) ;;;Create the text for the elevation text (if wElev (progn (if (= style 0) (command "text" "J" "ML" elevP ts "0" Zelev)) ;Places the bottom text. (if (/= style 0) (command "text" "J" "ML" elevP "0" Zelev)) ;Places the bottom text. (setq Elevtext (vlax-ename->vla-object (entlast))) ;get the text object );end progn );end if ;rotate the text and line to make it horizontal (setq viewrotation (getvar "viewtwist")) ;ucs twist (setq retval (vla-rotate theline (vlax-3d-point pt2) (* viewrotation -1))) (setq retval (vla-rotate toptext (vlax-3d-point pt2) (* viewrotation -1))) (setq retval (vla-rotate bottomtext (vlax-3d-point pt2) (* viewrotation -1))) (if wa (setq retval (vla-rotate atext (vlax-3d-point pt2) (* viewrotation -1))) ) (if wElev (setq retval (vla-rotate Elevtext (vlax-3d-point pt2) (* viewrotation -1))) );end if ;;;get the end point of the now rotated line this will also be the endpoint for the qleader (setq theLineCoords (vlax-variant-value (vla-get-Coordinates theline))) (setq newXPt (vlax-safearray-get-element theLineCoords 0)) (setq newYPt (vlax-safearray-get-element theLineCoords 0)) (setq newEndPt (list newXPt newYPt)) ;in order to avoid the the mtext dialog we set the default qleader settings above (setq ss (ssget "_X" (list (cons 0 "*MTEXT,TEXT")(cons 1 "Ex. TP*")))) (if wLeader (progn (vl-cmdf "qleader" pt1 pt2 newEndPt "") (vla-delete theline) ;delete our temp line );end progn );end if (Merge) (QlRestore) (setvar "cmdecho" 1) ;Turns on the command echo. (redraw) (NErestore-vars) (princ) );end defun (defun c:LNE () (bmcdNE T nil nil) (princ) );end defun (defun c:LNEL () (bmcdNE T nil T) (princ) );end defun (defun c:LNEEL () (bmcdNE T T T) (princ) );end defun (defun c:LNEE () (bmcdNE T T nil) (princ) );end defun (defun c:NEE () (bmcdNE nil T nil) (princ) );end defun (defun c:NEEL () (bmcdNE nil T T) (princ) );end defun (defun c:NEL () (bmcdNE nil nil T) (princ) );end defun (defun c:NE () (bmcdNE nil nil nil) (princ) );end defun I am using "lneel" as my command.
  13. I want to plot one particular layout in a drawing with multiple layouts. I want to set up a string of commands, using lisp, to print out the current/ open layout. Here is the current string I'm using: (defun c:plot40_B1 nil (vl-load-com) (command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "B1" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN39_BW.ctb" "YES" "W" "NO" "NO" "yes" ) (princ) ) This does not work - here is the F2 echo of the commands as they are processed by AutoCAD: plot40_KWIN39_BW _.-plot Detailed plot configuration? [Yes/No] <No>: yes Enter a layout name or [?] <K-17831>: Enter an output device name or [?] [url="file://kwifs1/KWIN_40"]\\KWIFS1\KWIN_40[/url]>: [url="file://kwifs1/KWIN_40"]\\Kwifs1\KWIN_40[/url] Enter paper size or [?] <A3>: A3 Enter paper units [inches/Millimeters] <Millimeters>: Millimeters Enter drawing orientation [Portrait/Landscape] <Landscape>: LANDSCAPE Plot upside down? [Yes/No] <No>: NO Enter plot area [Display/Extents/Layout/View/Window] <Extents>: Extents Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit>: FIT Enter plot offset (x,y) or [Center] <Center>: CENTER Plot with plot styles? [Yes/No] <Yes>: YES Enter plot style table name or [?] (enter . for none) <KWIN39_BW.ctb>: KWIN39_BW.ctb Plot with lineweights? [Yes/No] <Yes>: YES Scale lineweights with plot scale? [Yes/No] <Yes>: W The problem is this question: Enter a layout name or [?] : Currently the bit of the lisp that goes against that question is "". I have tried "Current" and "Layout", as I just want it to print the layout I have open, without entering a particular layout name, as this is obviously a print routine I want to use over and over again. Not sure what the > part of "Enter a layout name or [?] :" is. I am not sure what a valid answer is to "print current layout". I tried to turn off dialog boxes so I could find out what my options are at the command prompt, but can't figure this out. The old CmdDia = 0 doesn't work. Would greatly appreciate some advice!!!
  14. I have a LISP file that inserts a block. While inserting the block the user must pick the insertion point, and a rotation point, which gets stored as a local variable so that another block can be inserted in exactly the same place, at the same angle. Does anyone know if there is a way to allow the first block to be visible while inserting so the user can see the rotation angle? Also, is there a way to make the lisp follow whether Ortho is enabled? Thanks for your help!
  15. AfraLISP site says: "Now, save this file as "testline.lsp" remembering, to save it as a ASCII Text file and ensuring that it is saved in a directory in your AutoCAD's search path." 1- I couldn't find ASCII Text file in my notepad editor. Isn't ordinary txt file supported? 2- It says to save in a directory in your AutoCAD's search path. There are many path in Tools/options, file tab. Which is suitable for this purpose? BR Rasoul
  16. Hi all, I'm hoping someone who knows lisp and object codes could help me convert the attached filter setup into a ssget lisp, so I can call it on the command line, please! I've been looking at this thread, but I can't puzzle my way through it so far. My lisp skills are terrible to nonexistent! http://www.cadtutor.net/forum/showthread.php?21217-FILTER-Command I've attached a screenshot of the filter setup, and here's a clip from the filter.nfl file, if that's more helpful: (-4 . "(1 . "ose to any third party.") (1 . "3510") (-4 . "=") (62 . 166) (-4 . "=") (62 . 72) (-4 . "=") (62 . 251) (2 . "attr2-edit") (-4 . "(8 . "Paper Text") (0 . "*POLYLINE") (-4 . "AND>") (-4 . "OR>") :ai_str|PG ** Begin OR Text Value = ose to any third party. Text Value = 3510 Color = Color Color = Color Color = Color Block Name = attr2-edit ** Begin AND Layer = Paper Text Object = Polyline ** End AND ** End OR Thanks so much for the help...this will save me a ton of repetitive grind time!
  17. Hi! I am new here in the forum, and i would like to seek help from the experts. I am currently working on a lisp and including there is to check the system date or the validity of the lisp file, for a trial version of my work. But, i have problems when you set the system date like for Windows XP back to an older date the lisp will definitely work. Can someone make a lisp or just a simple routine that even when you backdate the System Date, the lisp will not be usable. Thanks in advance, Clixs
  18. Hi, I have created a macro command for my "dimaligned" so that every time i click on macro button and create a dimaligned it turns onto the good layers and i wanted to know if it is possible to remplace or create another dimaligned shortcut command (dal) by that macro command that i created. So everytime i would type Dimaligned or dal on the command prompts it would be my macro and not the standart dimaligned command. Is it possible? Heres my macro, ^C^C_-layer;_make;A-ANNO-DIMS;;_dimaligned; Thanks!
  19. Hi y'all, i have a lisp that create hatch on the layer i always use for hatch but i would like to see the dialog box not question on the command prompt and i would like that at the end of the command its return to the layer 0 automaticaly anyone knows how? here the lisp (defun c:H () (command "layer" "M" "A-HATC" "" "" "hatch") ) Thx!
  20. hey guys i have a file with 2 dozen layers each with objects in 12 different colors and i need to sort them out into layers depending on the objects color. e.g. all the objects with color "yellow" in one layer, all the objects with color "magenta" in another layer etc. can this be done with a lisp? can anyone help me i now nothing about writing lisp's
  21. Hi y'all, I would like to modify or replace all the original command like Text, MText, Hatch, all Dimension, Leaders, etc... is it possible to modify them so that when i type, for exemple "MT" on the command prompt, its automaticaly go on the good layers? Thanks!
  22. Does anyone know if it is possible to use LISP code to do these 3 things: 1. Insert a block (this is about as far as I can get myself) 2. Read a variable value (Useri5, for example) 3. Set a lookup table value based on the variable value. I have a bock with a lookup table with selectable values from 1-40. The block is for revision text on a drawing. The lookup table changes the block's attribute values to read off of Sheet Set custom properties. I already have a couple of functions for inserting a revision delta and have the number automatically populate based on the USERI5 variable, but I would also like to be able to have a function to insert the revision text block, and have it automatically set to the correct revision number. If anyone could help (or think you might be able to help, but my explanation was confusing) please please let me know. Thanks for reading my post and taking time to help out!
  23. Okay so two questions both relating to text in a multileader. 1) I have written a lisp that sets layer, creates a revcloud but when it gets the point at which it generates an mleader, I run into problems. Basically it draws the leader then ask me for the text in the command window. But soon as I hit space (as in between words) it finishes the command. I am hoping there is a way to pop up the normal dialog box that happens with multileaders so that the user can type in there entry hit okay then it finishes the lisp. 2) Second question, I am using a portion of a lisp from Ken Jolly that uses a series of texts in quote marks and then the user can select from them in a dialog box. it works great but for some of our longer texts I would like it if it could insert a 'return' to bring it to the next line. Is there a way to do that? See attached code. The one I have modified but not posted utilizes a mleader not a leader. '\n' did not work. Any help would be appreciated. note.zip
  24. I have created a vba macro to edit attributes in Blocks. I tried so many times but it doesn't update the attributes in drawing, unless I manually do a BATTMAN... What is wrong?
  25. Hey Guys, So I am trying to build a few tools to call in my AutoCAD functions but I am having some difficulties utilizing them. Below is a code to check and see if a layer exists. If it doesn't it creates the layer. Either way it the layer should be created at the end. I created the code "test123" to check and see if "laytool" is when it was passed a layer. I have tried several diffrent ways and searched for an answer but I haven't had any luck. Also I had "laytool" working before, slightly modified to be a user defined function. I get the following error when I run "test123" Command: test123 ; error: bad function: "ANNO-DIM" Command: Here is the original code: (defun c:test123 () (SETQ LAY2CHECK "ANNO-DIM") (SETVAR "CLAYER" (LAYTOOL (LAY2CHECK))) (princ "\n ALL DONE") ) (defun laytool (lay2check) ;Laytool R01 (if (not (tblsearch "LAYER" lay2check)) ;Checks to see if the layer exists (progn (cond ((= lay2check "ANNO-DIM") (setq lay2create '("ANNO-DIM" 190 "Continuous" "P"))) ((= lay2check "ANNO-INFCLD") (setq lay2create '("ANNO-INFCLD" 202 "Continuous" "P"))) ((= lay2check "ANNO-NPLT") (setq lay2create '("ANNO-NPLT" 240 "Continuous" "N"))) ((= lay2check "ANNO-RVCLD") (setq lay2create '("ANNO-RVCLD" 203 "Continuous" "P"))) ((= lay2check "ANNO-TEXT") (setq lay2create '("ANNO-TEXT" 205 "Continuous" "P"))) ((= lay2check "ANNO-XREF") (setq lay2create '("ANNO-XREF" 252 "Continuous" "P"))) (T (prompt "\nLayer is not in database")) ) (if (= lay2check (car lay2create)) (COMMAND "LAYER" "M" (car lay2create) "C" (cadr lay2create) (car lay2create) "P" (nth 4 lay2create) "") (princ "LAYER IS NOT IN DATABASE") ) ) (princ "Layer already exists") ) princ() lay2check ) Any help would be appreciated. Thank you. J
×
×
  • Create New...