Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
oohaah
Posts: 68
Registered: ‎02-08-2007
Message 1 of 6 (1,036 Views)
Accepted Solution

Stl.lisp steel shapes - insertion point problem

1036 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.

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.

 

 

Mentor
devitg
Posts: 1,705
Registered: ‎03-14-2004
Message 2 of 6 (1,024 Views)

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.

 

 

Valued Contributor
oohaah
Posts: 68
Registered: ‎02-08-2007
Message 3 of 6 (1,019 Views)

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.

Mentor
devitg
Posts: 1,705
Registered: ‎03-14-2004
Message 4 of 6 (1,000 Views)

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
*Expert Elite*
Kent1Cooper
Posts: 5,879
Registered: ‎09-13-2004
Message 5 of 6 (948 Views)

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
Mentor
devitg
Posts: 1,705
Registered: ‎03-14-2004
Message 6 of 6 (943 Views)

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))

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.