ERROR IN FUNCTION

ERROR IN FUNCTION

S_S_SS
Advocate Advocate
579 Views
14 Replies
Message 1 of 15

ERROR IN FUNCTION

S_S_SS
Advocate
Advocate

Hello every one
I've made a lisp code that consists of
1- (toc "1")
this make a list of (coordinates and integers ) the function ask getpoint and getreal and this stored to a list the name of the list is toc1

2-(d_concrete toc1)
this take the list and make some calculations to draw the shape of the concrete slab .

the expected thing that  the function (d_concrete toc1) will give the same results for the list toc1 if it have the same value

but the error in the function (d_concrete toc1) is that it gives more and more error shapes and after several times of calling the function it gives the correct shape

why this happen and how to fix this

thanks in advance
and i'll upload the DWG and link of a video that illustrate the issue ....

0 Likes
Accepted solutions (1)
580 Views
14 Replies
Replies (14)
Message 2 of 15

Kent1Cooper
Consultant
Consultant
Accepted solution

I have not studied your code in great detail, but that problem has all the characteristics of having running Object Snap modes on when you should not.  Try turning Osnap off, after getting the points and distances if that's appropriate.

Kent Cooper, AIA
0 Likes
Message 3 of 15

S_S_SS
Advocate
Advocate

Thanks this solve the problem 

0 Likes
Message 4 of 15

scot-65
Advisor
Advisor

@S_S_SS 

 

To supplement Kent's advise, 16384 can be added to the current OSMODE and subtracted when finished.

 

;set:
 (if (< (getvar "OSMODE") 16384) (setvar "OSMODE" (+ (getvar "OSMODE") 16384)))

;reset and inside *error*:
 (if (> (getvar "OSMODE") 16384) (setvar "OSMODE" (- (getvar "OSMODE") 16384)))

 

Why? Don't mess with the user's OSMODE. If you do, then allow the user to re-enable the setting from the status bar.

 

Another method is to inject a "_non" into the command statement.

Example: (command-s "-INSERT" a "_non" p1 (/ (nth 0 z1) 48.0) "" "0.0")

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

Message 5 of 15

S_S_SS
Advocate
Advocate

ok sir 
Thanks 

0 Likes
Message 6 of 15

Moshe-A
Mentor
Mentor

@S_S_SS 

 

Are open for another approach?   a bit advance then what yo got 😀

 

Attached cslab.zip file containing two files:

1. cslab.vlx lisp file

2. "sample for the question.dwg" (your drawing but modified)

 

open the dwg and load the lisp, we will start from what is interesting  

 

Command: CSLAB  (for Concrete Slab)

<this brings the following dialog box>

 

MosheA_0-1748890124930.png

<pick 'Draw Section' button>

 

Pick a slab:  <pick a slab\block> 

Specify first fence point:  <pick a point close to circle/start point>

Specify next fence point:  <move across the slab to the other side and pick point>

Section slab insert point: <pick section insertion point>

 

the section is drawn at once 😀

 

as you can see i change one beam to 250/900 and part of the slab to 200 mm. you have full control on each beam so slab.

 

As i saw in your video you pause at each point to specify slab depth + beam depth i thought this is not reasonable and some how there must be a way to plant these two values inside the slab so you can run it only by specifying a crossing\fence line.

 

so lets look at the dialog box

in Slab depth text box fill slab depth

in Beam depth fill beam depth 

 

to save the current values to slab edge pick 'Write data Slab <' button

Pick first slab edge:  <pick the first slab edge>

Pick next slab edge: <you can continue picking more edges to save the same data slab>

 

Cause the slab is a block, we can not use (ssget) only (entsel) to step edges.

to give you a visual feed back, the data is written (as xdata) to edge by adding a line in $CSLAB layer with 120 color,

this layer is set to plot off and you can turn if off\freeze if you like. (cslab does not need it on to work)

you need to be balance on specifying the right depth to the right edges according to working direction line.

when writing data to beam, the first edge should have slab + beam depths.

for slab, the first edge (which is the second edge of beam, should have slab depth + zero (0.00) depth to beam.

slab depth must always have a value <> 0.0 (negative values will turn positive)

 

Read data slab button will restore saved data slab to dialog.

Remove data slab button will delete saved data slab and if you enable All toggle, all data slabs is deleted.

 

enjoy,

Moshe

 

Message 7 of 15

Sea-Haven
Mentor
Mentor

Did you post this request elsewhee  ? I thought I responded that like @Moshe-A you could do a DCL that asks 1st how many sections, then asks for the info of those sections via DCL. Eg slab depth, beam depth, beam width & gap to next beam. It would keep values between each entry so minimise entries.

Message 8 of 15

Moshe-A
Mentor
Mentor

Anybody seen @S_S_SS  in other forums?

 

0 Likes
Message 9 of 15

Kent1Cooper
Consultant
Consultant

@Moshe-A wrote:

Anybody seen @S_S_SS  in other forums?


Yes.  [Just pick on their name at any of their posts to get into their profile, and scroll down to "Community participation" to see all their posts, identifying the Forum of each.]

Kent Cooper, AIA
0 Likes
Message 10 of 15

Moshe-A
Mentor
Mentor

thank you @Kent1Cooper  i didn't know that

looks like @S_S_SS  was visiting this forum consecutively for the last 7-8 months  🤔

0 Likes
Message 11 of 15

S_S_SS
Advocate
Advocate

Hello sir
yes i shared the request of the solution in theswamp and you answered me to turn off the osmode before the pline command 

0 Likes
Message 12 of 15

S_S_SS
Advocate
Advocate

Okay thanks sir 
it works correctly 
but the dwg of the slab plan isn't as simple as i shared 
kindly see the attached dwg and see the sections (A-B-C-D)
SOMETIMES THE TEXT IS LINES AND POLYLINES BECAUSE THE DWG IS PDF AND I CONVERT IT TO AUTOCAD 
so i preferred to write the values manual .
and the dwg s very big and have more and more data 
so i saw that it's very difficult to recognize all of these data correctly .
the problem with me was that i should turn off the osmode before the pline command not only before the getpoint 
and kindle @Sea-Haven  and @Kent1Cooper  told me this .
thanks sir for your effort and help.

0 Likes
Message 13 of 15

Moshe-A
Mentor
Mentor

@S_S_SS ,

 

Took a brief look at your dwg and i think this is simple to deal with, CSLAB already deal with it see section B-B i made with it

i understand you are holding it as block so it would be one object and that's ok with CSLAB it expect you to select a block.

and yes it is also look for plines (along lines). if you decide to work on exploded block, this will give us the option to use (ssget)

to select slab edges to plate slab data (slab depth + beam depth).

 

of course the program will need some adaptation\fine tunings but it is working with less effort ... 😀

 

??

 

Moshe

 

MosheA_0-1749539400187.png

 

 

 

Message 14 of 15

S_S_SS
Advocate
Advocate

Okay 
thanks for your kindly help sir 😁

0 Likes
Message 15 of 15

Sea-Haven
Mentor
Mentor

My take on task, draw slab in plan including beams, yes have code. Step 2 drag over the beams this gets you all the distances, then just via a dcl add the beam depths and type then draw section, last step add reo details for the section.

 

Happy to discuss a small fee may be applicable.