• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Active Contributor
    Posts: 34
    Registered: ‎02-08-2007
    Accepted Solution

    Stl.lisp steel shapes - insertion point problem

    319 Views, 5 Replies
    10-15-2012 05:45 PM

    HI All,

     

    I have been using this lisp for a while now and I've just realised when I insert an SHS section of 75 x 75mm the insertion point is off in the y direction by 0.5mm. It is only this section all other in SHS are ok.

     

    I'm no programming guru but I trolled through the script and dim files anyhow but I couldn't see how only this section could be off.

     

    Can anyone have a look and see if they can find the problem please?

     

    This is a great script for inserting steel sections and 3d models.

    Please use plain text.
    Distinguished Contributor
    Posts: 1,596
    Registered: ‎03-14-2004

    Re: Stl.lisp steel shapes - insertion point problem

    10-15-2012 08:12 PM in reply to: oohaah

    There was a BUG here 

     

     

    there is a misstake here
    (defun    DRAW_TS_SHAPE (/...
    ,
    ,
    ,
    ,
    ,
    
    (polar INSERT_PT (DTR 90) (/ OD_VERT 2))
    
    It shall be
    
    (polar INSERT_PT (DTR 90) (/ OD_VERT 2.0))
    
    as if  OD_VERT is an INT , 75 by example  , when divide by 2 it wil give 37 , and not
    37.5 as it shall be

     Change STL.lsp on your folder 

     

    I put a comment at CADALIST Tip1779: STL.ZIP

     

    I mailed to Al Rogers , but it´s e-mail refuse mine.

     

     

    Please use plain text.
    Active Contributor
    Posts: 34
    Registered: ‎02-08-2007

    Re: Stl.lisp steel shapes - insertion point problem

    10-15-2012 08:45 PM in reply to: devitg

    Well spotted, thankyou very much for taking the time. The lisp file you attached did not include the change however. I have attached again with the required fix.

     

    Cheers again.

    Please use plain text.
    Distinguished Contributor
    Posts: 1,596
    Registered: ‎03-14-2004

    Re: Stl.lisp steel shapes - insertion point problem

    10-16-2012 03:19 AM in reply to: oohaah
    We can learn from our´s error , and from other´s error too
    Please use plain text.
    *Expert Elite*
    Kent1Cooper
    Posts: 4,073
    Registered: ‎09-13-2004

    Re: Stl.lisp steel shapes - insertion point problem

    10-23-2012 12:24 PM in reply to: devitg

    devitg wrote:

    ....

    (polar INSERT_PT (DTR 90) (/ OD_VERT 2))

    It shall be

    (polar INSERT_PT (DTR 90) (/ OD_VERT 2.0)) 

    ....


    I notice there are other places in even the latest corrected routine, where things are divided by 2 as an integer.  Some are clearly real numbers that are being divided, so the result will not be rounded down to an integer, and it doesn't matter.  But at least some of them look analagous to the above-quoted situation, so [without digging too deeply into where all the variable values are coming from] I wonder whether there are other places where 2 should be changed to 2.0, that haven't given you a problem just because you may not have used those portions yet.  Look through for anywhere that the thing being divided will be an integer value.

    Kent Cooper
    Please use plain text.
    Distinguished Contributor
    Posts: 1,596
    Registered: ‎03-14-2004

    Re: Stl.lisp steel shapes - insertion point problem

    10-23-2012 02:41 PM in reply to: Kent1Cooper

    I did change all 2 where it shall be 2.0 , even in multiplications .

    I found some shapes with odd size , so they will give the same error 

    Not at NTH , neither in RTOS ,or  in DCL related lines

    Find attached 

     

    A few samples

     

     

     

     

     

    (defun
       DRAW_W_M_HP_SHAPE (/ R TW1 PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9 PT10
                          PT11 PT12 PT13 PT14 PT15 PT16 PT17 PT18 PT19 PT20
                         )
      (setq
        BF   (/ BF 2.0)
        TW   (/ TW 2.0)
    ************************************
    Changed to 2.0
    (defun
       DRAW_W_SHAPE_TOP (/ PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 ENT1 ENT2)
      (setq
        BF  (/ BF 2.0)
        TW  (/ TW 2.0)
    *********************************************
    Changed to 2.0
    (defun
       DRAW_S_SHAPE (/ TF1 TF2 PT1 PT2 HALF_TAN1 HALF_TAN2 HYPOT PT3 PT4 PT5
                     PT6 PT7 PT8 PT9 PT10 PT11 PT12 PT13 PT14 PT15 PT16 PT17
                     PT18 PT19 PT20 PT21 PT22 PT23 PT24 PT25 PT26 PT27 PT28
                    )
      (setq
        BF (/ BF 2.0)
        TW (/ TW 2.0)
    (- TF (* (/ (- BF TW) 2.0) 0.17632698))

     

     

    Please use plain text.