Results 1 to 5 of 5

Thread: Help with my Code

  1. #1
    Login to Give a bone
    0

    Default Help with my Code

    Hello everyone
    Thanks to all how can help with my code. I coded this H beam, but does not function properly. The dimensions do not match the input that is entered. I have coded a half dozen other profiles, but this one is a challenge to me. code included along with a sample sheet from a catalog that I use. As you can see there are dozens of profiles that fall under this H beam profile. My code does not include fillets and corners, I will study and learn how to add these in time.
    Thanks again for the help.

    Javier
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Default Re: Help with my Code

    (defun CON (a)
    (* PI (/ a 180.0))
    );defun

    (defun C:Huel (/ p1 rd1 rd2 rd3 rd4 rd5 rd6 rd6 rd8 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
    Old_Snap Old_Blip Old_Light)

    (setq Old_Snap (getvar "osmode")
    Old_Blip (getvar "blipmode")
    Old_Light (getvar "higlight")
    );setq

    (setvar "cmdecho" 0)
    (setvar "blipmode" 0)

    (setq p1 (getpoint "\nInsertion Point: "))
    (setvar "OSMODE" 0)
    (setq rd1 (getdist "\nEnter the Web Width: ")
    rd2 (getdist "\nEnter the Left Flange Height: ")
    rd3 (getdist "\nEnter the Right Flange Height: ")
    rd4 (getdist "\nEnter the Right Drop Length: ")
    rd5 (getdist "\nEnter the Left Drop Length: ")
    rd6 (getdist "\nEnter Right Flange Thickness T1: ")
    rd7 (getdist "\nEnter the Web Thickness T2: ")
    rd8 (getdist "\nEnter the Left Flange Thicknes T3: ")
    );setq


    (setq p2 (polar p1 (CON 270.0) rd8)
    p3 (polar p2 (CON 0.0) rd5)
    p4 (polar p3 (CON 270.0) (- rd1 rd8 rd6))
    p5 (polar p4 (CON 180.0) rd4)
    p6 (polar p5 (CON 270.0) rd6)
    p7 (polar p6 (CON 0.0) rd3)
    p8 (polar p7 (CON 90.0) rd6)
    p9 (polar p8 (CON 180.0) (- rd3 rd4 rd7))
    p10 (polar p9 (CON 90.0) (- rd1 rd8 rd6))
    p11 (polar p10 (CON 0.0) (- rd2 rd5 rd7))
    p12 (polar p11 (CON 90.0) rd8)
    );setq

    (command "PLINE" p1 "W" "" "" p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 "C")


    (prompt "\nRotation Angle: ")
    (command "rotate" "last" "" p1 pause)

    (setvar "OSMODE" Old_Snap)
    (setvar "BLIPMODE" Old_Blip)
    (setvar "HIGHLIGHT" Old_Light)
    (princ)
    );defun

  3. #3
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Default Re: Help with my Code

    Ojala y pueda Ayudarte¡
    disculpa por mi mal inglés. Soy de México

    Code:
    (defun CON (a)					
    (* PI (/ a 180.0))
    );defun	 
    
    (defun C:Huel (/ p1 rd1 rd2 rd3 rd4 rd5 rd6 rd6 rd8 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
    		Old_Snap Old_Blip Old_Light)	
    
    (setq Old_Snap (getvar "osmode")			
          Old_Blip (getvar "blipmode")
         Old_Light (getvar "higlight")
    );setq
    
    (setvar "cmdecho" 0)				
    (setvar "blipmode" 0)
    
    (setq p1 (getpoint "\nInsertion Point: "))	
    (setvar "OSMODE" 0)				
    (setq  rd1 (getdist "\nEnter the Web Width: ") 
               rd2 (getdist "\nEnter the  Left Flange Height: ") 
               rd3 (getdist "\nEnter the Right Flange Height: ") 
               rd4 (getdist "\nEnter the Right Drop Length: ") 
               rd5 (getdist "\nEnter the Left Drop Length: ") 
               rd6 (getdist "\nEnter Right Flange Thickness T1: ") 
               rd7 (getdist "\nEnter the Web Thickness T2: ") 
               rd8 (getdist "\nEnter the Left Flange Thicknes T3: ")          
    );setq
    
    
    (setq p2 (polar p1 (CON 270.0) rd8)
             p3 (polar p2 (CON 0.0) rd5)
             p4 (polar p3 (CON 270.0) (- rd1 rd8 rd6))
             p5 (polar p4 (CON 180.0) rd4)
             p6 (polar p5 (CON 270.0) rd6)
             p7 (polar p6 (CON 0.0) rd3)
             p8 (polar p7 (CON 90.0) rd6)
             p9 (polar p8 (CON 180.0) (- rd3 rd4 rd7))
             p10 (polar p9 (CON 90.0) (- rd1 rd8 rd6))
             p11 (polar p10 (CON 0.0) (- rd2 rd5 rd7))
             p12 (polar p11 (CON 90.0) rd8)      	
    );setq
    
    (command "PLINE" p1 "W" "" ""  p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 "C")					
    
    
    (prompt "\nRotation Angle: ")			
    (command "rotate" "last" "" p1 pause)		
    
    (setvar "OSMODE" Old_Snap)			
    (setvar "BLIPMODE" Old_Blip)
    (setvar "HIGHLIGHT" Old_Light)
    (princ)						
    );defun
    Attached Files Attached Files

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Help with my Code

    In the original code there was an error calculating pt9

    Code:
     (setq pt9  (polar pt8   (* pi 1.5) (- RFH (+ RDL T2 ))))
    Switch this line and it worked for me.

    P=
    AutomateCAD

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Help with my Code

    There is a number of free programs out there for drawing H beams search for Wiseyssteelshapes is one that comes to mind.

    If you want to draw multiple H beams you are much better of saving the details to a text file and just matching the beam name, this is the way the commercial products work. Just read in all the values, this example uses a csv file method as there is convert csv to list.lsp out there.

    I also noticed that the beam has no radius at the flange and web some beams do have this but it depends on how accurate you want to be.

    250UB25,250,100,12,10,12
    250UB30,250,100,14,12,12

Similar Threads

  1. Allow Other Code Compilers for ARX Code
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2013-02-10, 08:06 AM
  2. Need help with code
    By paulof in forum AutoLISP
    Replies: 6
    Last Post: 2008-06-25, 06:23 PM
  3. Insert vbscript code has not code
    By buzz in forum AMEP General
    Replies: 3
    Last Post: 2008-02-09, 03:08 AM
  4. Convert VBA code to VB code
    By Robert Platt in forum VBA/COM Interop
    Replies: 20
    Last Post: 2007-08-15, 10:13 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
  •