Jump to content

Recommended Posts

Posted

I'm writing lisp to draw a pipe Reducer Tee with 2 different size values.

I have not search the forum to look for one. But anyway here's my code;

 

 
1. Prompt for Input; size A and size B; pipe rating
2. Read from table specified. (.txt file)
(read-line .txtfile)
(repeat 6

Example of data.
  C1 C2 C3 C4
R1 V1 V2 V3 V4
R2 V1 V2 V3 V4
R3 V1 V2 V3 V4
R4 V1 V2 V3 V4
R5 V1 V2 V3 V4
R6 V1 V2 V3 V4

The first column R1,R2, R3... the values for sizes
The next column V1,V2 V3... the values for column rating.
C1,C2...represent the column rating

3. Check to match for sizes in column one. (atof (substr .txtfile 1 3))
  (if statement for size input)
4. If match found at step 3; then check column C1,C2...C4 that match for 
  rating. (if statement for rating)
5. Get the value V1....V4 that match input sizes and rating.
  (atof (substr .txtfile __ __))
6. Draw the object.

The problem I have, in the above code is that I have two sizes for input values and I can only get one of them using the above code.

 

Is there a way I can improve my code to get two values in one loop, say R2-V2 and R4-V2.

 

Thanks.

Posted
I'm writing lisp to draw a pipe Reducer Tee with 2 different size values.

I have not search the forum to look for one. But anyway here's my code;

 

 
1. Prompt for Input; size A and size B; pipe rating
2. Read from table specified. (.txt file)
(read-line .txtfile)
(repeat 6

Example of data.
  C1 C2 C3 C4
R1 V1 V2 V3 V4
R2 V1 V2 V3 V4
R3 V1 V2 V3 V4
R4 V1 V2 V3 V4
R5 V1 V2 V3 V4
R6 V1 V2 V3 V4

The first column R1,R2, R3... the values for sizes
The next column V1,V2 V3... the values for column rating.
C1,C2...represent the column rating

3. Check to match for sizes in column one. (atof (substr .txtfile 1 3))
  (if statement for size input)
4. If match found at step 3; then check column C1,C2...C4 that match for 
  rating. (if statement for rating)
5. Get the value V1....V4 that match input sizes and rating.
  (atof (substr .txtfile __ __))
6. Draw the object.

The problem I have, in the above code is that I have two sizes for input values and I can only get one of them using the above code.

 

Is there a way I can improve my code to get two values in one loop, say R2-V2 and R4-V2.

 

Thanks.

 

 

Check out this link:

 

http://www.cadtutor.net/forum/showthread.php?t=33919

Posted

Oh by the way, If you are trying to get the above code to work and you need help with it, Please post the complete code. You do not have much there to work with.

Posted

I had the first thought of using (cond) statement to put the values in

but then I thought of using the txt or data file.

 

I have already a code working but I have to input the values.

Now I have to use the (cond) statement; it's the only way to go.

 

Thanks Buzzard. Thank you for the link and the offer.

 

BTW I'm in fiberglass; pipe has different values from steel.

Posted
I had the first thought of using (cond) statement to put the values in

but then I thought of using the txt or data file.

 

I have already a code working but I have to input the values.

Now I have to use the (cond) statement; it's the only way to go.

 

Thanks Buzzard. Thank you for the link and the offer.

 

BTW I'm in fiberglass; pipe has different values from steel.

 

Sorry, Did not fully understand the problem.

Posted
Sorry, Did not fully understand the problem.

 

Please, Don't be sorry.

 

Cheers.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...