LIsp for Z axis Value ?

Discussion in 'AutoCAD' started by DeviL, Dec 13, 2004.

  1. DeviL

    DeviL Guest

    I`m interested in terrain modeling.
    Got an acad file with all the data needed about the site ...
    ( izohipses ((?) - don`t know if `s an English word),
    and a lot 2D points - but all on zero elevation !!!
    :-(
    So I started to elevate them to the Z value they represent, and found
    out it`s a long and boring process.
    Someone has made this routine easier before - I`m sure!
    But whats the name of that routine ???
    Lisp ?

    Help help help
     
    DeviL, Dec 13, 2004
    #1
  2. DeviL

    Pete Guest

    Maybe a stupid question but me ask anyway:
    How do you determine the Z value if the points are all 2D with zero
    elevation?
     
    Pete, Dec 15, 2004
    #2
  3. DeviL

    DeviL Guest

    the text string represents the z value
     
    DeviL, Dec 15, 2004
    #3
  4. DeviL

    Arad Gazit Guest

    Hi Devil,

    In this case you can use Autodesk Map (If you have it) to query the points
    and use the text value to change their height.

    Arad
     
    Arad Gazit, Dec 15, 2004
    #4
  5. While not impossible, it's unlikely that you will just
    "find" a LISP to do something so specific. It wouldn't
    be that hard to write one to do it, but you have to
    decide if it would be worth it. If there are 10,000 of these things
    it would definitely be worth it. If there are only 200,
    probably not, depending on how you frame the question.

    There is something that may not enter into your equation
    that deserves to be considered: What is the long term
    benefit to learning how to create custom routines that
    improve your productivity? In my case this was huge.
    Friends of mine who knew me before I could write routines
    are still doing things the same old (dumb, slow) way. When
    they see how quickly I can do things, it appears to them like "magic",
    but it's not, its the return on an investment (in time) that I made.

    What you want to do sounds like it could be broken down to
    two tasks, one simpler than the other: Read the number, them move the point.
    Reading the number is the harder part and depends on whether
    the number is an attribute or a separate entity near the point in question.
    The move part is dead simple.
    --


    MichaelB
    www.michaelbulatovich.com
    (the local Kludge distributor)
     
    Michael Bulatovich, Dec 15, 2004
    #5
  6. DeviL

    DeviL Guest

    I actually did it manualy ...

    4 800 points

    I did over and over the same commands :

    Selected a Text Object
    CopyPasted the string into Filter Command - Text Value = xx.xx
    Select All
    Change Elevation - Pasted string
    Changed Color (so I could see the diference between changed and not changed
    Strings)

    Then the next one

    Since its so simple but time consuming, i thought someone should have
    written the Lisp long time ago.

    The dwg was geodetical situation, were the
    points (text objects) were
    positioned at the right x and y axis but the z value was = 0, only
    information about the z value was the
    point itself.
    I saw this often. It`s how Geodets make it here (Croatia).
    Since I`m not familiar with Lisp, I was thinking:
    "How hard could it be for somenoe who knows to make such a routine"

    I took the po2txt.lsp, and changed ONE thing - it works (surprise) for what
    I wanted.
    Exporting the x,y,z values off Text (positioned in 3d) into a txt file.

    But the process of taking those text in the right elevation was - uuuh ...
     
    DeviL, Dec 15, 2004
    #6
  7. Wow. That must have hurt.
     
    Michael Bulatovich, Dec 15, 2004
    #7
  8. DeviL

    DeviL Guest

    It still does .....

    So, could the Lisp be writen ?
     
    DeviL, Dec 16, 2004
    #8
  9. DeviL

    DeviL Guest

    I don`t have Autodesk Map.

    Lisp ?
     
    DeviL, Dec 16, 2004
    #9
  10. DeviL

    Francis Guest

    Try this

    (DEFUN C:11 ( / SelSet NumElm Counter Elm Type TextPt TxtX TxtY TxtZ Pt)
    (SETQ SelSet (SSGET))
    (SETQ NumElm (SSLENGTH SelSet))
    (SETQ Counter 0)
    (REPEAT NumElm
    (SETQ Elm(ENTGET(SSNAME SelSet Counter)))
    (SETQ Counter(+ 1 Counter))
    (SETQ LTYPE(ASSOC 0 Elm))
    (IF (= "TEXT" (CDR LTYPE))
    (PROGN
    (SETQ TextPt (cdr (ASSOC 10 Elm)))
    (setq TxtX (rtos (car TextPt) 2 3))
    (setq TxtY (rtos (cadr TextPt) 2 3))
    (Setq TxtZ (rtos (atof (cdr (Assoc 1 Elm))) 2 3))
    (setq Pt (strcat TxtX "," TxtY "," TxtZ))
    (command "_Point" Pt ))))
    (princ)
    )

    The problem is the 3D points created might not on the position of your 2D
    point.
    Anyway, hope this help. Good Day.
     
    Francis, Dec 16, 2004
    #10
  11. You have to do MORE?
    (Don't cut off the entire message when replying.)
     
    Michael Bulatovich, Dec 16, 2004
    #11
  12. DeviL

    DeviL Guest

    Thx all for repliing

    I allready got a really excelent one.

    Daniel Hargreaves wrote it specially for this issue yesterday.

    It not only exports the text strings into an txt file but also prompts
    for elevating the strings.

    Works great !!!
    If someone is interasted in it, I could post it ....
     
    DeviL, Dec 17, 2004
    #12
  13. DeviL

    Freddex

    Joined:
    Apr 3, 2019
    Messages:
    1
    Likes Received:
    0
    DeviL can you send me it maybe, just was serching for exactly this on alot of forums and here is the answer!

    Old post but i try it!
    Send me a PM!
     
    Freddex, Apr 3, 2019
    #13
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.