Results 1 to 4 of 4

Thread: SELECTING MULTIPLE POINTS TO CREATE A MULTI LEADER TO AUGMENT AN EXISTING CUSTOM LISP

  1. #1
    Member
    Join Date
    2018-03
    Posts
    12
    Login to Give a bone
    0

    Default SELECTING MULTIPLE POINTS TO CREATE A MULTI LEADER TO AUGMENT AN EXISTING CUSTOM LISP

    At present we have a number of LISP routines that I've inherited from previous CAD drafters that noone (including me) fully understands. I've managed to add/manipulate some of them, in a basic fashion, to better reflect what we need to be automated. The final hurdle to resolving most of the "We'll just manually type that stuff in" BS is way beyond my understanding.

    In the attached .dwg there's a survey file of a pick-up of a stormwater drainage pit. The call-out for the 'invert' is our usual flow/size/material/depth leader, both Lisps attached.

    What I need to be able to do is to expand the selection from a single point to all pipes coming in-out of the pit, the 5 magenta points in the .dwg attached represent the 5 inlet-outlets to the pit and have the attributes of :

    NAME , CODE , ELEVATION , DEPTH , SIZE , MATERIAL , END , FLOW , NOTE , METHOD

    Our invert callout pulls out : FLOW , SIZE (%%C) , MATERIAL , DEPTH

    I'm trying to do 2 things with the information :

    1: select multiple points, (replacing car with ssget?) and write them all into a mleader consecutively with the CODE at the start, which we'll nominate for the identifier number on the screen in CAD and

    2: generate a fifth attribute called INVERT which would be (I assume) (setq invert (- elevation material).

    so I'd get a mleader something like CODE - INLET - 125%%C - PVC
    "TAPE DEPTH" - DEPTH"m"
    "INVERT" - INVERT"m"
    CODE - INLET - 125%%C - PVC
    "TAPE DEPTH" - DEPTH"m"
    "INVERT" - INVERT"m"
    CODE - OUTLET - 125%%C - PVC
    "TAPE DEPTH" - DEPTH"m"
    "INVERT" - INVERT"m"

    Any of the points (probably the first one chosen) can be the insertion points for the mleader.

    Any help would be much appreciated
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: SELECTING MULTIPLE POINTS TO CREATE A MULTI LEADER TO AUGMENT AN EXISTING CUSTOM LISP

    Please find and send or upload some defun , like

    varopen

    GA

    Coordw

    Varclose
    it must be at the main lisp .

  3. #3
    Member
    Join Date
    2018-03
    Posts
    12
    Login to Give a bone
    0

    Default Re: SELECTING MULTIPLE POINTS TO CREATE A MULTI LEADER TO AUGMENT AN EXISTING CUSTOM LISP

    Hey dev, sorry i was away for easter.

    We have a LISP in the library name "var.lsp" I'm guessing this is what you're requesting?

    (defun GA (Blname / )
    (setq depth () NAME () COED () ELEVATION () UTILITY () NOTE () )
    (setq 1Att (entnext Blname))
    (setq 1AtEnt (entget 1Att))
    (while (/= (cdr (assoc 0 1AtEnt)) "SEQEND")
    (progn
    (setq tag (cdr (assoc 2 1AtEnt)))
    (set (read tag) (cdr (assoc 1 1AtEnt)))
    (setq lay (cdr (assoc 8 1AtEnt)))
    (setq 1Att (entnext 1Att))
    (setq 1AtEnt (entget 1Att))
    )
    )
    )

    (defun Varopen ( / )
    (setq ceho (getvar "CMDECHO"))
    (setq blm (getvar "blipmode"))
    (setq atd (getvar "attdia"))
    (setq OSM (getvar "osmode"))
    (setq cl (getvar "clayer"))

    (setq cs (atoi(vl-string-subst "" "1:" (getvar "cannoscale"))))

    (setvar "CMDECHO" 1)
    (setvar "blipmode" 0)
    (setvar "attdia" 0)
    (setvar "osmode" 0)
    (princ)
    )



    (defun Varclose ( / )
    (setvar "CMDECHO" ceho)
    (setvar "blipmode" blm)
    (setvar "attdia" atd)
    (setvar "osmode" osm)
    (setvar "clayer" cl)
    (princ)
    )

    TY

  4. #4
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: SELECTING MULTIPLE POINTS TO CREATE A MULTI LEADER TO AUGMENT AN EXISTING CUSTOM LISP

    Here is an attempt needs a bit of fine tuning but does work just not 100% to match your needs, leave to you to customise.

    Code:
    (defun c:labelpit ( / ss obj pt atts att )
    (setq ss (ssget '((0 . "insert"))))
    (repeat (setq x (sslength ss1))
    (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
    (if (vlax-property-available-p obj "hasattributes")
    (setq atts (vlax-invoke obj "getattributes"))
    )
    (setq lst2 '())
    (foreach att atts
    (setq lst2 (cons (vla-get-textstring att) lst2))
    )
    
    (setq pt (vlax-safearray->list (vlax-variant-value (vlax-get-property obj 'insertionpoint))))
    (COMMAND "_MLEADER" pt PAUSE (strcat (nth 0 lst2) "\n" (nth 2 lst2 )))
    )
    )
    (c:labelpit)
    Last edited by BIG-AL; 2018-04-17 at 11:57 AM.

Similar Threads

  1. Create a Hatch by Selecting Points
    By Wish List System in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2017-02-26, 12:00 AM
  2. Replies: 13
    Last Post: 2014-01-20, 06:14 PM
  3. multiple connection point for leader tails when using a multi-leader
    By jschraud228486 in forum AutoCAD Annotation
    Replies: 1
    Last Post: 2010-06-16, 01:42 AM
  4. Replies: 4
    Last Post: 2006-09-15, 08:04 PM

Posting Permissions

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