Results 1 to 2 of 2

Thread: Merging two LIPS routines in one

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2015-10
    Posts
    1
    Login to Give a bone
    0

    Default Merging two LIPS routines in one

    Hello Im trying to merge two different Lips routines. As long as I want area and perimeter from a polyline. Ive got two separate routines for this. But when it came to a huge amount of polylines... its a hard work. can you help me how to merge those routines into one:

    Area text:

    ;;; Uses TEXTSIZE for the text height

    (defun Get-ObjectIDx64 (obj / util)
    (setq util (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))))
    (if (= (type obj) 'ENAME)(setq obj (vlax-ename->vla-object obj)))
    (if (= (type obj) 'VLA-OBJECT)
    (if (> (vl-string-search "x64" (getvar "platform")) 0)
    (vlax-invoke-method util "GetObjectIdString" obj :vlax-False)
    (rtos (vla-get-objectid obj) 2 0)
    )
    )
    )

    (defun c:AT (/ entObject entObjectID InsertionPoint ad)
    (vl-load-com)
    (setq entObject (vlax-ename->vla-object(car (entsel)))
    entObjectID (Get-ObjectIDx64 entObject)
    InsertionPoint (vlax-3D-Point (getpoint "Select point: "))
    ad (vla-get-ActiveDocument (vlax-get-acad-object))
    )
    (vla-addMText (if (= 1 (vla-get-activespace ad))
    (vla-get-modelspace ad)
    (if (= (vla-get-mspace ad) :vlax-true)
    (vla-get-modelspace ad)
    (vla-get-paperspace ad)
    )
    )
    InsertionPoint 0.0 (strcat
    "%<\\AcObjProp Object(%<\\_ObjId "
    entObjectID
    ">%).Area \\f \"%lu2%pr2%ps[, m2]%ct8[1e-006]\">%"
    ))
    )

    AND

    Perimeter text


    ;;; Uses TEXTSIZE for the text height

    (defun Get-ObjectIDx64 (obj / util)
    (setq util (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))))
    (if (= (type obj) 'ENAME)(setq obj (vlax-ename->vla-object obj)))
    (if (= (type obj) 'VLA-OBJECT)
    (if (> (vl-string-search "x64" (getvar "platform")) 0)
    (vlax-invoke-method util "GetObjectIdString" obj :vlax-False)
    (rtos (vla-get-objectid obj) 2 0)
    )
    )
    )

    (defun c:PT (/ entObject entObjectID InsertionPoint ad)
    (vl-load-com)
    (setq entObject (vlax-ename->vla-object(car (entsel)))
    entObjectID (Get-ObjectIDx64 entObject)
    InsertionPoint (vlax-3D-Point (getpoint "Select point: "))
    ad (vla-get-ActiveDocument (vlax-get-acad-object))
    )
    (vla-addMText (if (= 1 (vla-get-activespace ad))
    (vla-get-modelspace ad)
    (if (= (vla-get-mspace ad) :vlax-true)
    (vla-get-modelspace ad)
    (vla-get-paperspace ad)
    )
    )
    InsertionPoint 0.0 (strcat
    "%<\\AcObjProp Object(%<\\_ObjId "
    entObjectID
    ">%).Length \\f \"%lu2%pr2%ps[, m]%ct8[1e-003]\">%"
    ))
    )

  2. #2
    Member
    Join Date
    2015-10
    Posts
    7
    Login to Give a bone
    0

    Default Re: Merging two LIPS routines in one

    This will give you 2 options. both on one line (pat) or each on a separate line (pat2) I just added the all of the field code to the other and for one line separated them with a "," for pat2 I did the same except separated them with "\\P" which is the code in mtext for another line. I also add prefix text to each one
    Attached Files Attached Files

Similar Threads

  1. Autocad Lips to copy dimension text tol clipboard
    By TheDetailer in forum AutoLISP
    Replies: 2
    Last Post: 2013-02-12, 08:11 AM
  2. Lips routine for special Array
    By ionutste in forum AutoLISP
    Replies: 7
    Last Post: 2012-04-03, 07:16 AM
  3. Merging Corridors
    By DBill2508 in forum AutoCAD Civil 3D - Corridors
    Replies: 1
    Last Post: 2012-03-07, 10:25 AM
  4. Merging NWD and NWF files
    By civicduty in forum NavisWorks - General
    Replies: 4
    Last Post: 2011-11-21, 08:06 PM
  5. X Ref and Merging
    By jquinn.193583 in forum AutoCAD 3D (2007 and above)
    Replies: 2
    Last Post: 2011-03-28, 06:07 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
  •