See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Automate wear plate drawing

  1. #1
    Member
    Join Date
    2019-03
    Posts
    32
    Login to Give a bone
    0

    Default Automate wear plate drawing

    During shut downs we get requests for many wear plates very quickly. These are generally a rectangle with 2 to 4 holes.

    What I am hoping for is a way to do something like the following just by entering the x and y coordinates:

    rec (manual select point) -X,Y rec @X1,-Y1 X2,-Y2, circle on 4 corners of the last rectangle, delete the last rectangle, then repeat.

    I don't know if all of this can be done but as much as possible would be great.
    Attached Files Attached Files

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    1

    Default Re: Automate wear plate drawing


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

    Default Re: Automate wear plate drawing

    I have a "base plate" routine I wrote a while back that "sort of" does what you need.
    You pick the "center point" and it builds a rectangle and (4) circles (holes) from that point based on user input.
    So it would need to be symmetrical from the center for it to work for you.

    I removed some of my original code, so it just draws the plate on a layer and places a point at the center on a no-plot layer

    I see some others have posted some other solutions, (in the other forum) but maybe this can help someone.
    You may want to change layer names or whatever suits your needs.

    Code:
    ;;;;WAREPLATE.LSP, BY TED G.
    (defun C:WPLT (/ p1 p2 p3 p4 p5 p6 p7 p8 p9 LR1 LR2 LR3 osm la cmde len abdia lenhalf flen flenhalf strt_point wid widhalf fwid fwidhalf xp1 xp2 xp3 xp4 xp5 xp6 xp7 yp1 yp2 yp3 yp4 yp5 yp6 yp7)
    (setq cmde (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (setvar "pdmode" 0)
    (command "-units" "4" "16" "1" "2" "" "n")
    (setq strt_point (getpoint "Select start Point (center of PLT) Type a Coordinate or Pick the Point "))(terpri)
    (setq len (getdist "How wide is your plate horizontally? "))(terpri)
    (setq wid (getdist "How high is your plate vertically? "))(terpri)
    
    (setq flen (getdist "Distance between holes horizontally? "))(terpri)
    (setq fwid (getdist "Distance between holes vertically? "))(terpri)
    
    (setq abdia (getdist "Diameter of AB holes? "))(terpri)
    
    (setq lenhalf (/ len 2))
    (setq widhalf (/ wid 2))
    
    (setq flenhalf (/ flen 2))
    (setq fwidhalf (/ fwid 2))
    
    ;;sets start point (center of plate), for placing point on noplot layer
    
    (setq Xp1 (car strt_point))
    (setq yp1 (cadr strt_point))
    (setq p1 (list xp1 yp1 0))
    
    ;;creates points for plate corners
    
    (setq xp2 (- xp1 lenhalf))
    (setq yp2 (- yp1 widhalf))
    (setq p2 (list xp2 yp2 0))
    
    (setq xp3 (+ xp2 len))
    (setq yp3 yp2)
    (setq p3 (list xp3 yp3 0))
    
    (setq xp4 xp3)
    (setq yp4 (+ yp3 wid))
    (setq p4 (list xp4 yp4 0))
    
    (setq p5 (list xp2 yp4 0))
    
    ;;creates points for holes
    
    (setq xp5 (- xp1 flenhalf))
    (setq yp5 (- yp1 fwidhalf))
    (setq p6 (list xp5 yp5 0))
    
    (setq xp6 (+ xp5 flen))
    (setq yp6 yp5)
    (setq p7 (list xp6 yp6 0))
    
    (setq xp7 xp6)
    (setq yp7 (+ yp5 fwid))
    (setq p8 (list xp7 yp7 0))
    
    (setq p9 (list xp5 yp7 0))
    
    (setq osm (getvar "osmode"))
    (setvar 'osmode 0)
    (setq la (getvar "clayer"))
    	(SETQ LR1 (TBLSEARCH "LAYER" "S-PLATE"))
    	(SETQ LR2 (TBLSEARCH "LAYER" "S-NPLT"))
    	        (IF (= LR1 NIL)  
    		(command "layer" "make" "S-PLATE" "color" "7" "" "lw" "0.35" "" ""))
    		(IF (= LR2 NIL)
    		(command "layer" "make" "S-NPLT" "COLOR" "1" "" "PLOT" "N" "" "lw" "0.18" "" ""))
    (setvar "cmdecho" cmde)
    (command "layer" "t" "S-NPLT" "S" "S-NPLT" "")
    (command "point" p1 "")
    (command "layer" "t" "S-PLATE" "S" "S-PLATE" "")
    (command "pline" p2 p3 p4 p5 "c")
    (command "circle"  p6 "d" abdia "")
    (command "circle"  p7 "d" abdia "")
    (command "circle"  p8 "d" abdia "")
    (command "circle"  p9 "d" abdia "")
    (setvar "osmode" osm)
    (setvar "clayer" la)
    (princ)
    )
    
    (princ "WAREPLATE.lsp Loaded, command: WPLT..see command line for prompts")

Similar Threads

  1. Automate location of object to be inserted into drawing
    By ron.peralta in forum VBA/COM Interop
    Replies: 1
    Last Post: 2007-06-14, 02:13 PM
  2. Replies: 10
    Last Post: 2007-02-07, 07:48 PM
  3. Automate Drawing Update When Modifing a Presentation
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2006-12-24, 04:57 AM
  4. Automate a coil strip layout for a rectangular blank
    By robert.1.hall72202 in forum AutoLISP
    Replies: 8
    Last Post: 2005-09-08, 04:59 PM
  5. The Last Coat you 'll Ever wear
    By ariasdelcid in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-12-16, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •