Jump to content

Search the Community

Showing results for tags 'prefix'.



More search options

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

    Prefix Layout Name

    I have multiple layout tabs in a single drawing. I want to add use-given prefix to them so when i use publish command, i can segregate them properly thru its prefix. I searched the forum and i cannot find anything. Can somebody help me?
  2. Hello Again I found this script that i wanna change because it does not work well when layouts are not "Layout 1", "Layout 2" , etc even for example if i already have the layouts numbered but have to create another one or simply re-arrange them (alert "Use at command line to execute program:\n\n numlay") (defun c:numlay (/ i) (vl-load-com) (setq i 0) (foreach x (layoutlist) (vla-put-name (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)) ) x ) (strcat (itoa (setq i (1+ i)))) ) ) (princ) ) I wanna it to : 1) Auto-number Layout using the sequence in which they really are 2) That autonumbering prefix an 0 before the number if it is this last topic i tryied using this code without sucess .... (cond ((and (> i 0) (< i 10)) (strcat "0" (itoa i)) ) thx in advanced
  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. Hi, Task 1: I need help on adding prefix to an attribute tag named ITEM_NUMBER but dont want to increment. Below is a code from Lee Mac that has prefix + increment and I tried to manipulate it but was unsuccessful. Could some one help me please? Also, prefix would change between different drawings. So, if its asks for prefix, would be great. Task #2 The ultimate goal is that once I add prefix to item number, I will copy this and modify to add prefix to BALIN tag (which is a balloon). This way I will have same prefix+number for the ITEM_NUMBER and BALIN tags. Task #3 Once this is done, and everything arranged on the drawing, I would like a utility to renumber the item numbers by removing prefix and re-incrementing it. And while doing that, It should changes at both places at once (since the prefix + number are exact both places). The tricky thing here is that multiple balloon could reference the same number since that part could be used at multiple places. Not sure if this sounds feasible? But if it does, It will save a big time headache for me since some of my drawings have about 50+ items and balloon which needs to be arranged. (defun c:incatt ( / tag pre ss1 ) (vl-load-com) (setq tag "ADDRESS" pre "ADDRESS: ") (if (setq *num* (cond ( (getint (strcat "\nSpecify Starting Number" (if *num* (strcat " <" (itoa *num*) "> : ") ": ")))) ( *num* ))) (while (setq ss1 (ssget "_+.:E:S:L" '((0 . "INSERT") (66 . 1)))) (if (vl-some (function (lambda ( x ) (if (eq tag (vla-get-tagstring x)) (not (vla-put-textstring x (strcat pre (itoa *num*)))) ) ) ) (vlax-invoke (vlax-ename->vla-object (ssname ss1 0)) 'getattributes) ) (setq *num* (1+ *num*)) (princ (strcat tag " Attribute not found.")) ) ) ) (princ) )
  5. 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!
×
×
  • Create New...