+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Full Member Luís Augusto's Avatar
    Discipline
    Electrical
    Luís Augusto's Discipline Details
    Occupation
    Designer / Planner
    Discipline
    Electrical
    Details
    Manufacture of electrical harnesses
    Using
    AutoCAD 2010
    Join Date
    Apr 2012
    Location
    Botucatu, SP, Brazil
    Posts
    80

    Default Routine modification Dims2Field

    Registered forum members do not see this ad.

    In looking for a lisp routine that performs the sum selected dimensions, found one that I believe to be ideal for my work.
    Could the author or another member of the forum to make a change?
    It would be ideal for me to make the sum property>%). TextOverride>% Rotated Dimension object.
    I tried to make the change but as I am not aware that language still did not succeed. Returns the error "misplaced dot on input".

    Below the original routine.

    Dims2Field.lsp
    Code:
    (defun c:Dims2Field ( / *error* spc doc pt uFlag ss ids )
    (vl-load-com)
    ;; © Lee Mac 2010
    
    (defun *error* ( msg )
    (and uFlag (vla-EndUndomark doc))
    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
    (princ (strcat "\n** Error: " msg " **")))
    (princ)
    )
    
    (setq spc
    (if
    (or
    (eq AcModelSpace
    (vla-get-ActiveSpace
    (setq doc
    (vla-get-ActiveDocument
    (vlax-get-acad-object)
    )
    )
    )
    )
    (eq :vlax-true (vla-get-MSpace doc))
    )
    (vla-get-ModelSpace doc)
    (vla-get-PaperSpace doc)
    )
    )
    
    (if (and (ssget '((0 . "*DIMENSION")))
    (setq pt (getpoint "\nPick Point for Field: ")))
    (progn
    (setq uFlag (not (vla-StartUndoMark doc)))
    
    (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
    (setq Ids
    (cons (GetObjectID obj doc) Ids)
    )
    )
    (vla-delete ss)
    
    (vla-AddMText spc (vlax-3D-point pt) 0.
    
    (if (= 1 (length Ids))
    (strcat "%<\\AcObjProp Object(%<\\_ObjId " (car Ids) ">%).Measurement \\f \"%lu6\">%")
    (strcat "%<\\AcExpr"
    (lst->str Ids " %<\\AcObjProp Object(%<\\_ObjId " ">%).Measurement >% +")
    ">%).Measurement >% \\f \"%lu6\">%"
    )
    )
    )
    
    (setq uFlag (vla-EndUndomark doc))
    )
    )
    (princ)
    )
    
    (defun lst->str ( lst d1 d2 )
    ;; © Lee Mac 2010
    (if (cdr lst)
    (strcat d1 (car lst) d2 (lst->str (cdr lst) d1 d2))
    (strcat d1 (car lst))
    )
    )
    
    (defun GetObjectID ( obj doc )
    ;; © Lee Mac 2010
    (if
    (eq "X64"
    (strcase
    (getenv "PROCESSOR_ARCHITECTURE")
    )
    )
    (vlax-invoke-method
    (vla-get-Utility doc) 'GetObjectIdString obj :vlax-false
    )
    (itoa (vla-get-Objectid obj))
    )
    )
    Thank in advanced.
    Luis Augusto.

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,506

    Default

    Registered forum members do not see this ad.

    We'll give this thread a *bump* and see if it draws any response. Good luck.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

Similar Threads

  1. Little modification to this Lisp.
    By Saqib_theleo in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 21st Nov 2012, 04:49 pm
  2. Need little modification for this lisp
    By cadamrao in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 6th Jul 2012, 04:53 am
  3. Modification of LISP
    By cadamrao in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 3rd May 2010, 10:04 am
  4. Ellipse Modification
    By JCAMP17 in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 13
    Last Post: 5th Dec 2008, 08:57 pm
  5. Command modification
    By johnengineer in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 16th Mar 2007, 06:18 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts