Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stl.lisp steel shapes - insertion point problem

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
oohaah
3371 Views, 8 Replies

Stl.lisp steel shapes - insertion point problem

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.

8 REPLIES 8
Message 2 of 9
devitg
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.

 

 

Message 3 of 9
oohaah
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.

Message 4 of 9
devitg
in reply to: oohaah

We can learn from our´s error , and from other´s error too
Message 5 of 9
Kent1Cooper
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, AIA
Message 6 of 9
devitg
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))

 

 

Message 7 of 9

only stl draughting utility appers.. after that its not working..

 

Message 8 of 9
devitg
in reply to: ferdinand.alvaro

As per comments at LSP.

 

;COMPANION FILES:
;STL.LSP HAS 22 COMPANION FILES THAT ARE REQUIRED TO BE IN THE SAME
;DIRECTORY IN ORDER TO FUNCTION. THESE FILES ARE NAMED AS FOLLOWS:
;STL.DCL, STL_HELP.TXT, STL_C.DIM, STL_C_BAR.DIM,STL_HP.DIM, STL_L.DIM,
;STL_M.DIM, STL_MC.DIM, STL_MET_EA.DIM, STL_MET_C.DIM, STL_MET_R.DIM,
;STL_MET_W.DIM, STL_MT.DIM, STL_P.DIM, STL_PX.DIM, STL_PXX.DIM, STL_S.DIM,
;STL_ST.DIM, STL_TS_RECT.DIM, STL_TS_SQ.DIM, STL_TUBE.DIM, STL_W.DIM,
;STL_WT.DIM. THESE FILES CONTAIN THE DIALOG (.DCL) CODE, A HELP FILE (.TXT)
;AND THE DATA TABLES FOR SHAPE DIMENSIONS (.DIM).;COMPANION FILES:
;STL.LSP HAS 22 COMPANION FILES THAT ARE REQUIRED TO BE IN THE SAME
;DIRECTORY IN ORDER TO FUNCTION. THESE FILES ARE NAMED AS FOLLOWS:
;STL.DCL, STL_HELP.TXT, STL_C.DIM, STL_C_BAR.DIM,STL_HP.DIM, STL_L.DIM,
;STL_M.DIM, STL_MC.DIM, STL_MET_EA.DIM, STL_MET_C.DIM, STL_MET_R.DIM,
;STL_MET_W.DIM, STL_MT.DIM, STL_P.DIM, STL_PX.DIM, STL_PXX.DIM, STL_S.DIM,
;STL_ST.DIM, STL_TS_RECT.DIM, STL_TS_SQ.DIM, STL_TUBE.DIM, STL_W.DIM,
;STL_WT.DIM. THESE FILES CONTAIN THE DIALOG (.DCL) CODE, A HELP FILE (.TXT)
;AND THE DATA TABLES FOR SHAPE DIMENSIONS (.DIM).

 

Find attached

Message 9 of 9
devitg
in reply to: devitg

All such files shall be in a trusted folder  by ACAD. 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost