See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Need help with LISP to set Elevation of selection to Zero by point on object.

  1. #1
    Member
    Join Date
    2018-10
    Posts
    3
    Login to Give a bone
    0

    Question Need help with LISP to set Elevation of selection to Zero by point on object.

    I'm looking for a lisp that would allow me to select several entities, select a point, then move all objects selected, from point selected, to an elevation of zero by the WCS.

    Something along the lines of:

    Move
    Select Objects
    Select Base Point
    (automation kicks in)
    Select Second Point
    .z of 0,0,0
    (at) @ ""

    Code:
    (defun c:mtz ()
       (command "move"
          pause
          ".z"
          "0,0,0"
          "@")
    )
    The pause is not working as I had hoped and I'm new enough to lisp that I'm not sure where to start with the deeper functions in autocad such as dxf data.
    Last edited by rkmcswain; 2018-11-21 at 12:26 PM. Reason: added [CODE] tags

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    3,047
    Login to Give a bone
    0

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    FLATTEN (Express Tool)
    or
    CHANGE (Command)
    or
    just set the Elevation to 0 in the Properties Palette.
    Tom Beauford P.S.M. - Civil 2019 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

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

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    Thanks Tom, but unfortunately those options will not work for what I'm trying to accomplish.

    I need to move a selection set, by selecting a point on an object (which could be an end point, mid point, nearest point, ect.) and having that point moved to Zero Elevation, while the objects within that selection set maintain the same distances from each other and the selected point (including z distances).

  4. #4
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    4
    Login to Give a bone
    1

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    Have a look at the attached Modz lisp. It does exactly what you want, but will allow you to enter the elevation in the dialog box (default is zero).

    This is my own creation, so constructive criticism is welcome.

    modz.jpg
    Attached Files Attached Files

  5. #5
    I could stop if I wanted to CadDog's Avatar
    Join Date
    2005-06
    Location
    So Ca
    Posts
    435
    Login to Give a bone
    0

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    Does the job WELL...!!!!
    Thanks for making this job a lot easier...
    Jesse
    aka CadDog © 1994
    All is Well until It Fails
    Remember, that what you teach me here you are also teaching others...

  6. #6
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    4
    Login to Give a bone
    0

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    I'm glad you like it!

  7. #7
    Member
    Join Date
    2018-10
    Posts
    3
    Login to Give a bone
    0

    Default Re: Need help with LISP to set Elevation of selection to Zero by point on object.

    This is almost exactly what I am looking for.

    Can you add a second Pick option, that moves the entity first selected to the defined elevation, but all other objects in the selection set maintain relative distance from the first entity?

    It does a great job of what you intended, thank you for sharing!

Similar Threads

  1. 2009: Create a Selection set from Civil 3D point group or point description.
    By sdrewinc432892 in forum AutoCAD Civil 3D - General
    Replies: 12
    Last Post: 2016-08-05, 07:01 PM
  2. Replies: 3
    Last Post: 2014-09-16, 06:29 PM
  3. LISP command to make decimal point act as point marker?
    By JRBOURNE in forum AutoCAD Civil 3D - General
    Replies: 9
    Last Post: 2012-06-30, 11:37 AM
  4. Object selection using lisp
    By ReachAndre in forum AutoLISP
    Replies: 4
    Last Post: 2006-10-25, 08:53 PM
  5. changing elevation for civil point object
    By chrisw.94380 in forum Land Desktop - General
    Replies: 2
    Last Post: 2006-02-07, 02:27 PM

Tags for this Thread

Posting Permissions

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