See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: Has anyone seen a lisp routine that will match elevations?

  1. #1
    All AUGI, all the time pauljordan's Avatar
    Join Date
    2004-09
    Location
    Rock -- Me -- Hard Place
    Posts
    749
    Login to Give a bone
    0

    Default Has anyone seen a lisp routine that will match elevations?

    In MEP, I'm always trying to make one cable tray the same height as another. Currently I have to select the tray, check my properties, copy the elevation, then select the second tray and paste the elevation..

    Has anyone see a lisp routine to match elevations in MEP??

    Cable tray, conduit, pipe, etc..etc..
    Give a man AutoCad, and he'll draw you a floor plan.
    Give a man Revit and he'll build you a house.
    Give Cadmama a couple of drinks and she'll have everyone singing Rockytop!

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Has anyone seen a lisp routine that will match elevations?

    I work with Infrastructure Design Suite, which ironically does not include AMEP but does include Revit, however I am an ADN member and can download... Before I do that, try using vlax-Dump-Object to dig through the desired MEP Object's Properties to see if an Elevation Property is exposed, and is not read-only?

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    1

    Default Re: Has anyone seen a lisp routine that will match elevations?

    Assuming that MEP Objects use an Elevation Property to store the data you modify in Properties Palette, and not a dynamically calculated value like Pipe Center, for Invert, etc. as is the case in Civil 3D:

    Code:
    (vl-load-com)
    
    (defun c:FOO (/ *error* e sourceObject ss targetObject acDoc)
    
      (defun *error* (msg)
        (if acDoc
          (vla-endundomark acDoc)
          )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (if
        (and
          (setq e (car (entsel)))
          (setq sourceObject (vlax-ename->vla-object e))
          (vlax-property-available-p sourceObject 'elevation)
          (setq ss (ssget ":S:E:L"))
          (setq targetObject (vlax-ename->vla-object (ssname ss 0)))
          (vlax-property-available-p targetObject 'elevation)
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
           )
           (vla-put-elevation targetObject (vla-get-elevation sourceObject))
         )
         (cond
           (targetObject
            (prompt
              "\n** Target object does not have an \"Elevation\" Property ** "
            )
           )
           ((and sourceObject (not ss))
            (prompt
              "\n** Source object does not have an \"Elevation\" Property ** "
            )
           )
         )
      )
      (*error* nil)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  4. #4
    All AUGI, all the time pauljordan's Avatar
    Join Date
    2004-09
    Location
    Rock -- Me -- Hard Place
    Posts
    749
    Login to Give a bone
    1

    Default Re: Has anyone seen a lisp routine that will match elevations?

    THAT.... IS..... AWESOME.....

    At first it was doing all kinds of wonky things but, then I realized my UCS wasn't set to World.

    Gotta admit, you lost me at the VLoad dump thing. I write dirty lisp, no checking or anything. Just dirty and quick to get the job done.

    Many thanks. It will definitely be used a lot..
    Give a man AutoCad, and he'll draw you a floor plan.
    Give a man Revit and he'll build you a house.
    Give Cadmama a couple of drinks and she'll have everyone singing Rockytop!

  5. #5
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    1

    Default Re: Has anyone seen a lisp routine that will match elevations?

    Quote Originally Posted by pauljordan View Post
    THAT.... IS..... AWESOME.....

    At first it was doing all kinds of wonky things but, then I realized my UCS wasn't set to World.

    ...

    Many thanks. It will definitely be used a lot..
    That is kind of you to say, pauljordan; I'm happy to help thumbsup.gif... Even when I don't have the right application, or a sample drawing to test! rofl.gif



    Quote Originally Posted by pauljordan View Post
    Gotta admit, you lost me at the VLoad dump thing. I write dirty lisp, no checking or anything. Just dirty and quick to get the job done.
    I started that way too, and found that it only took a small amount of extra work to save me more time down the road.

    In any event, what I was getting at was to cull the target Object's exposed Properties, and Methods with something simple like this:

    Code:
    (vl-load-com)
    
    (defun c:DUMP (/ eName)
      (if (setq eName (car (entsel "\nSelect object: ")))
        (progn
          (vlax-dump-object (vlax-ename->vla-object eName) T)
          (textpage)
        )
      )
      (princ)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 9
    Last Post: 2012-12-15, 06:45 PM
  2. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 10:33 PM
  3. match objects elevations only.
    By rh62mtb in forum AutoCAD General
    Replies: 3
    Last Post: 2010-03-02, 11:37 AM
  4. Match Elevations??
    By pauljordan in forum AMEP General
    Replies: 3
    Last Post: 2009-02-23, 05:45 PM
  5. Topography elevations does not match survey
    By jwilhelm in forum Revit Architecture - General
    Replies: 1
    Last Post: 2005-05-02, 01:38 AM

Posting Permissions

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