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)
)