Jump to content

Search the Community

Showing results for tags 'suffix'.

  • 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...

Found 5 results

  1. I've looked around and have found Suffix/Prefix routines for Text, Mtext and Attributes. I thought it would be easy to modify one of those to work with dimensions but easier said than done. I cannot figure it out. I was hoping one of these two routines would be easy to rework to work with dimensions. For this first one, I thought adding DIMENSION to the associative list would work but my understanding is limited evidently... My desire is to add a prefix/suffix to multiple dimensions. As far as dimensions are concerned does (0 . "DIMENSION") cover them all? (defun c:ftxt(/ cMod cStr tSet) (vl-load-com) (initget 1 "Prefix Suffix") (setq cMod(getkword "\nAdd [Prefix/Suffix]: ")) (if(and (setq cStr(getstring T "\nSpecify string: ")) (setq tSet(ssget '((0 . "TEXT,MTEXT")))) ;Adding DIMENSION didn't work for me ); and (foreach tx(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex tSet)))) (if(= "Prefix" cMod) (vla-put-TextString tx (strcat cStr(vla-get-TextString Tx))) (vla-put-TextString tx (strcat(vla-get-TextString Tx)cStr)) ); end if ); end foreach ); end if (princ) ); end of c:ftxt The other routine I thought would be easy was this one... (defun c:test ( / as el en i ss str typ ) (initget "Prefix Suffix") (setq typ (cond ((getkword "\nAdd Prefix or Suffix? [Prefix/Suffix] <Prefix>: ")) ("Prefix"))) (setq str (getstring t (strcat typ " to Add: "))) (if (setq ss (ssget '((0 . "INSERT") (66 . 1)))) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i)))) (while (eq "ATTRIB" (cdr (assoc 0 (setq el (entget (setq en (entnext en))))))) (setq as (cdr (assoc 1 el))) (if (eq "Prefix" typ) (if (not (wcmatch as (strcat str "*"))) (entmod (subst (cons 1 (strcat str as)) (assoc 1 el) el)) ) (if (not (wcmatch as (strcat "*" str))) (entmod (subst (cons 1 (strcat as str)) (assoc 1 el) el)) ) ) ) ) ) (princ) ) Help please!! Big thanks to the original code writers!
  2. Good morning! I have not had any luck in finding much that my novice LISP skills can fix up to suit my needs. Perhaps someone here has something laying around? I am looking to have a LISP that does the following: allows the user to select one or more dimensions Allows user to pick from 3-4 options with the underlined letter being what the command needs: (XHM), (THR), (YJM), and (CPA) Then add the user selected string as a dimension suffix to the selected dimension. We add suffixes to dimensions often, and there are several different ones we use daily. Just looking to save time by having a command that will add the selected string to the suffix. Does anyone have anything similar? I am able to do some editing to suit my needs, but I don't even know where to start with editing a dimension suffix via LISP. Thanks in advance!
  3. Hello all. I have a routine that enters data labels in a drawing where the user would like them. It finds data in a file and inserts it based on the label number the user inputs. However, for the data labels that we enter that have no information, but the user still wants that label called out, it simply enters "#50.00-0.00". I was able to remove the "0.00" suffix because it was obvious in the code. But I would also like to remove ".00" immediately after the data label, and this isnt working out in my favor. The only thing that I would like displayed is "#50-". No decimals and no zeros. I have included the routine. and snap shot of the data labels. With the original on bottom. The current in the middle. And the goal data label I am looking for on top. Hope this helps and plenty thanks in advance. (defun c:DTEST (/ *ERROR* oldlayr p1 p2 DPNUM) (defun *error* (msg) (if oldlayr (setvar "clayer" oldlayr)) (if oldos (setvar "osmode" oldos)) (if msg (prompt msg)) (princ) ) (defun getdpnum () (if (= dpnum nil) (setq dpnum (getreal "\nEnter STARTING datapoint number (1.00-999.99): ")) (setq dpnum (+ dpnum 1))) ) (WHILE (setq oldos (getvar "osmode")) (setq oldlayr (getvar "clayer")) (command "._-layer" "s" DATAPOINT "") (initget 1) (setq p1 (getpoint "\nSelect datapoint location on pipe: ")) (setvar "osmode" 0) (initget 33) (setq p2 (getpoint p1 "\nSelect datapoint label location: ")) (getdpnum) (get_info "DATAPOINTS" "END DATAPOINTS" DPINFO "#" "-") (command "._-layer" "s" oldlayr "") (setvar "OSMODE" OLDOS) ) (*error* nil) (prin1))
  4. I have ALMOST 1000 unique mtexts. I want to append a second line, with the same text, to ALL of them at once. All the current mtexts are different, with different character lengths, so I cannot use 'find and replace'. However, they are are all on the same layer and easily selectable as a group. Is there an easy way to do this? Lisp or otherwise? i.e. originals: "12345" "abcde" "..." desired results: "12345 HOUSE" "abcde HOUSE" "... HOUSE" Thanks
  5. hi.. need help on creating lsp that can: > save out a copy each on all opened dwgs to specified folder with suffix increase as per existing by next number! example; ``````` Currently opened dwgs: abc.dwg , def.dwg , ghi.dwg , etc.dwg when the command function is execute, it will create a copy each in specified folder same as the above opened filenames with a suffix added as shown below; c:\documents & settings\user\backup\abc_1.dwg c:\documents & settings\user\backup\def_1.dwg c:\documents & settings\user\backup\ghi_1.dwg if the second time of the command function is execute, it will save another copy with increment of 1 as per existing filename as shown below; c:\documents & settings\user\backup\abc_2.dwg c:\documents & settings\user\backup\def_2.dwg c:\documents & settings\user\backup\ghi_2.dwg thanks
×
×
  • Create New...