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.
Solved! Go to Solution.
Solved by devitg. Go to Solution.
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.
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.
@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.
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))
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