Results 1 to 2 of 2

Thread: Lumber dimension lisp

  1. #1
    100 Club
    Join Date
    2004-12
    Posts
    153
    Login to Give a bone
    0

    Default Lumber dimension lisp

    Here are some quick type offsets for lumber. You just need to type in x2,x4,x6,x8,x10,or x12 and it will start the offset with the actual size of the lumber

    x2=1.5
    x4=3.5
    x6=6.5
    x8=7.25
    x10=9.25
    x12=11.25

    copy the whole thing into notepad and save as by.lsp

    (DEFUN C:X2()(COMMAND "OFFSET" 1.5))
    (DEFUN C:X4()(COMMAND "OFFSET" 3.5))
    (DEFUN C:X6()(COMMAND "OFFSET" 5.5))
    (DEFUN C:X8()(COMMAND "OFFSET" 7.25))
    (DEFUN C:X10()(COMMAND "OFFSET" 9.25))
    (DEFUN C:X12()(COMMAND "OFFSET" 11.25))

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: Lumber dimension lisp

    Here's a routine I wrote to do the end view of dimensional lumber.
    I'm sure it can be improved on, but basically it draws a rectangle with an "X" in it on the correct layers (at our office) with your input. You need to put in the length and width.

    Code:
    ;;;;STUD.LSP, BY TED GOULET 2003 
    ;;;;(7-8-03): Added the following functions: 
    ;;;;	Turn off running osnaps within routine 
    ;;;; 	Thawed the necessary layers
    ;;;;	Returned to current layer when done
    ;;;;***********************************************************************
    
    ;;;;Draws an end view of dimensional lumber
    
    ;;;;***********************************************************************
    (defun C:std (/ p1 p2 p3 p4 LR1 LR2 osm la)
    (setq strt_point (getpoint "Select start Point"))(terpri)
    (setq len (getdist "How wide is your stud?"))(terpri)
    (setq wid (getdist "How high is your stud?"))(terpri)
    (setq Xp1 (car strt_point))
    (setq yp1 (cadr strt_point))
    (setq p1 (list xp1 yp1 0))
    (setq xp2 (+ xp1 len))
    (setq yp2 yp1)
    (setq p2 (list xp2 yp2 0))
    (setq xp3 xp2)
    (setq yp3 (+ yp2 wid))
    (setq osm (getvar "osmode"))
    (setq la (getvar "clayer"))
    (setq p3 (list xp3 yp3 0))
    (setq p4 (list xp1 yp3 0))
    	(SETQ LR1 (TBLSEARCH "LAYER" "S-DETL-0003"))   
    	(SETQ LR2 (TBLSEARCH "LAYER" "S-DETL-0001"))
    		(IF (= LR1 NIL)
    		(command "layer" "make" "S-DETL-0003" "color" "3" "" ""))
    		(IF (= LR2 NIL)
    		(command "layer" "make" "S-DETL-0001" "color" "1" "" ""))
    (setvar "osmode" 16384)
    (command "layer" "t" "S-DETL-0003" "S" "S-DETL-0003" "" "")
    (command "pline" p1 p2 p3 p4 "c") 
    (command "layer" "t" "S-DETL-0001" "S" "S-DETL-0001" "" "")
    (command "LINE" p1 p3 "")
    (command "LINE" p2 p4 "")
    (setvar "osmode" osm)
    (setvar "clayer" la)
    (princ)
    )
    (princ "STUD loaded. ")
    (princ "command: STD ")
    (princ)
    I thought it would be good to share, it has allot of potential.

Similar Threads

  1. Help me lisp Export dimension, text from a drawing
    By minhphuong.humg453254 in forum AutoLISP
    Replies: 0
    Last Post: 2013-12-02, 04:34 PM
  2. Lisp - Specify dimension line location
    By paulof in forum AutoLISP
    Replies: 4
    Last Post: 2011-09-17, 10:51 AM
  3. Dimension Lisp Help!!!!
    By g_wong in forum AutoLISP
    Replies: 5
    Last Post: 2009-01-12, 07:28 PM
  4. Replies: 15
    Last Post: 2006-11-21, 02:37 PM
  5. Dimension Lisp
    By BCrouse in forum AutoLISP
    Replies: 1
    Last Post: 2005-11-21, 04:48 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
  •