Porting AutoCAD LSP to trueSpace?

Technical questions, etc..
Post Reply
Galane
Chief Petty Officer
Posts: 111
Joined: 30 Aug 2009, 10:45

Porting AutoCAD LSP to trueSpace?

Post by Galane »

Specifically, could Al's Steel Mill be converted to be used in trueSpace? Convert to Python?

http://www.structuralsteeldetailer.us/?page_id=21" onclick="window.open(this.href);return false;

LSP files are text, code like this snippet.

Code: Select all

  ;--------------------------INTERNAL ERROR HANDLER---------------------;
(defun
   STL_ERR (MSG)
  (if (or (/= MSG "Function cancelled")
  ; If an error (such as ESC) occurs
          (= MSG "quit / exit abort")
      ) ;_ end of or
    (princ)
    (princ (strcat "\nError: " MSG))
  ) ; while this command is active...
  (setvar "OSMODE" OS) ; Restore saved modes
  (setvar "PLINEWID" PLW)
  (setq *ERROR* OLDERR) ; Restore old *error* handler
  (princ)
) ;end STL_ERR
  ;------------------------------MAIN PROGRAM----------------------------;
(defun DTR (A) (* pi (/ A 180.0)))
  ;----------------------------------------------------------------------;     
(defun RTD (A) (/ (* A 180.0) pi))
  ;----------------------------------------------------------------------;
  ;Read data file and parse "size string", nth 0, for display in
  ;list box as variable display_list.
(defun
   STL_READ_DIM_FILE (/ A AA)
  (STL_SET_NIL)
  (setq A "")
  (STL_DEFAULTS)
  (STL_OPEN_DIM_FILE)
  (while (/= A NIL)
    (setq A (read-line STL_DIM_FILE))
    (if (/= A NIL)
      (progn
        (setq
          A  (nth 0 (read A))
          AA (append AA (list A))
        ) ;_ end of setq
      ) ;end progn
    ) ;end if
  ) ;end while
  (setq DISPLAY_LIST (reverse AA))
  (close STL_DIM_FILE)
  (start_list "get_size")
  (mapcar 'add_list DISPLAY_LIST)
  (end_list)
) ;end STL_READ_DIM_FILE
  ;-----------------------------------------------------------------------;

stan
Master Chief Petty Officer
Posts: 532
Joined: 21 May 2009, 17:20

Re: Porting AutoCAD LSP to trueSpace?

Post by stan »

this might be of use to you but it works with free sketchup, not sure on what exports it has that truespace can use.. http://sketchup.engineeringtoolbox.com/ ... -to_2.html" onclick="window.open(this.href);return false;

Post Reply