Results 1 to 7 of 7

Thread: 3DPOLY within a lisp

  1. #1
    All AUGI, all the time Mlabell's Avatar
    Join Date
    2004-12
    Location
    Toledo, OH
    Posts
    513
    Login to Give a bone
    0

    Default 3DPOLY within a lisp

    Here is my brutal attempt at lisp. What I am trying to accomplish is creating a breakline from 3d points and also create a copy of the 3d polyline convert it to a 2d line and change the 2d line to another layer. I would like to run the 3dpoly command inside the lisp, but my abilities are not quite there. Attached is my code and drawing. When drawing the 3d pline draw from the center of circles.
    Attached Files Attached Files
    Last edited by GuinnessCAD; 2007-02-28 at 08:52 PM. Reason: Clarify my thoughts

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Hopefully, I can look at this later today. Until then, look at this post regarding the CMDACTIVE system variable.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    All AUGI, all the time Mlabell's Avatar
    Join Date
    2004-12
    Location
    Toledo, OH
    Posts
    513
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Quote Originally Posted by Opie
    Hopefully, I can look at this later today. Until then, look at this post regarding the CMDACTIVE system variable.
    I tried using the CMDACTIVE unsuccessfully. I just need to figure out how to pause the lisp until the 3d polyline has been drawn, any ideas?

  4. #4
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Quote Originally Posted by marklabell
    I tried using the CMDACTIVE unsuccessfully. I just need to figure out how to pause the lisp until the 3d polyline has been drawn, any ideas?
    Try again . .
    Code:
    (command "_3dpoly")
    (while (= (getvar "CMDACTIVE") 1 ) (command pause) )
    : ) Happy Computing !

    kennet

  5. #5
    All AUGI, all the time Mlabell's Avatar
    Join Date
    2004-12
    Location
    Toledo, OH
    Posts
    513
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Quote Originally Posted by kennet.sjoberg
    Try again . .
    Code:
       (command "_3dpoly")
       (while (= (getvar "CMDACTIVE") 1 ) (command pause) )
    : ) Happy Computing !

    kennet
    OK that works, now the flatten command wont work in lisp. But it works just keying in the command on my computer, is that normal? Flatten is not lisp compatable?
    Revised code:

    Code:
      
      
      ;;;Program Name topo-pave.LSP
      ;;;Author: Mark LaBell Jr.
      ;;;February 28, 2007
      ;;;This lisp routine draws a road breakline, and the road geometry in 2d.
      ;;; ----------------------------------------------------------------------------
      ;;; DISCLAIMER:  Mark LaBell Jr. Disclaims any and all liability for any damages
      ;;; arising out of the use or operation, or inability to use the software.
      ;;; FURTHERMORE, User agrees to hold Mark LaBell Jr. harmless from such claims.
      ;;; Mark LaBell Jr. makes no warranty, either expressed or implied, as to the
      ;;; fitness of this product for a particular purpose.  All materials are
      ;;; to be considered ‘as-is’, and use of this software should be
      ;;; considered as AT YOUR OWN RISK.
      ;;; ----------------------------------------------------------------------------
      (defun C:rd ()
      ;;;
      ;;;Get user variables
      ;;;
       (setq c_layer (getvar "clayer"))
       (setq o_mode (getvar "osmode"))
      ;; (setvar "osmode" 8)
      ;;(command "cmdecho" 0)
       (command "undo" "be" )
      ;;;
      ;;;Create layers for desired output
      ;;;
       (command "-layer" "m" "SM-BRKLN-RD" "c" "7" "SM-BRKLN-RD" "th" "SM-BRKLN-RD" "")
       (command "-layer" "m" "EX-RD-PAVED" "c" "131" "EX-RD-PAVED" "th" "EX-RD-PAVED" "")
       (command "-layer" "m" "EX-RD-UNPAVED" "c" "131" "EX-RD-UNPAVED" "th" "EX-RD-UNPAVED" "")
      ;;;
      ;;;Thaw and turn on layers for desired output
      ;;;
       (command "-layer" "t" "SM-BRKLN-RD" "")
       (command "-layer" "t" "EX-RD-PAVED" "")
       (command "-layer" "t" "EX-RD-UNPAVED" "")
      ;;;
      ;;;Draw 3d poly
      ;;;
       (command "clayer" "SM-BRKLN-RD" )
       (command "_3dpoly"  )
       (while (= (getvar "CMDACTIVE") 1 ) (command pause) )
      ;;;
      ;;;Copy 3d geometry to Pave layer
      ;;;
        (command "_copybase" "0,0,0" "l" "")
        (command "_pasteclip" "0,0,0" )
        (setq road (getstring "\nEnter Layer which the breakline will reside on: EX-RD-PAVED or EX-RD-UNPAVED "))
        (command "change" "P" "" "p" "LA" road "")
        (command "_flatten" "p" "n" "")   
        (command "explode" "l" "")
      ;;;
      ;;;Return User variables
      ;;;
       (setvar "clayer" c_layer)
       (setvar "osmode" o_mode)
       (command "undo" "e" )
       (command "cmdecho" 1) 
       (princ)
       (prompt "You have created a breakline and the road.")
      (princ)
      )
    Last edited by GuinnessCAD; 2007-03-02 at 05:16 PM.

  6. #6
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Quote Originally Posted by marklabell
    OK that works, now the flatten command wont work in lisp. But it works just keying in the command on my computer, is that normal? Flatten is not lisp compatable?
    Flatten is not an AutoCAD command, I suppose it is a lisp that you have loaded,
    you can not call a lisp within a lisp as a command, you must use the lisp way
    (flatten) or (c:flatten) or (flatten arg1 arg2 . . ) or
    sorry I can not help you here, I do not have the flatten file.

    : ) Happy Computing !

    kennet

  7. #7
    All AUGI, all the time Mlabell's Avatar
    Join Date
    2004-12
    Location
    Toledo, OH
    Posts
    513
    Login to Give a bone
    0

    Default Re: 3DPOLY within a lisp

    Quote Originally Posted by kennet.sjoberg
    Flatten is not an AutoCAD command, I suppose it is a lisp that you have loaded,
    you can not call a lisp within a lisp as a command, you must use the lisp way
    (flatten) or (c:flatten) or (flatten arg1 arg2 . . ) or
    sorry I can not help you here, I do not have the flatten file.

    : ) Happy Computing !

    kennet
    Gotcha, I actually just programmed a super move into the lisp,
    Code:
      (command "._move" "p" "" "0,0,1e99" "")
      (command "._move" "p" "" "0,0,-1e99" "")

Similar Threads

  1. 3DPOLY Lisp routine problems....
    By cstark804917 in forum AutoLISP
    Replies: 1
    Last Post: 2013-05-02, 07:22 AM
  2. 3d face a 3dpoly
    By elvis6585m in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2009-09-09, 06:56 PM
  3. 3dpoly
    By wilofer76 in forum AutoLISP
    Replies: 3
    Last Post: 2009-07-28, 10:11 PM
  4. pline to 3dpoly?
    By mateo in forum AutoCAD General
    Replies: 3
    Last Post: 2005-11-09, 01:03 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
  •