using repeat command
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-26 06:24 PM
2015-10-26
06:24 PM
im trying to do a if and repeat command.
if (no_pan_0-sla_pan_0)>0 then
i=1
repeat
gosub 20
add2 pan_m,0
i= i+1
until i>(no_pan_0-sla_pan_0)
endif
it works perfectly in 2D as left hand side of image shows but in 3D it doesn't. The object is for a kit of parts that the client has designed and so it can have a comination of panel types. Hence the if and repeat.
the best the 3D gets is one of each panel type.
Any assistance greatly welcomed.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-26 07:38 PM
2015-10-26
07:38 PM
Hi.
You are just showing the 2D script, right? (I only see ADD2)
Remember that 2D script and 3D script are different things. You might get by with one REPEAT cycle in 2D, but in 3D you may need more to accomplish what you want. You may be missing some coordinate transformations to correctly position the panels in each iteration.
Other than that, is difficult to know how you want the object to work.
Best regards.
You are just showing the 2D script, right? (I only see ADD2)
Remember that 2D script and 3D script are different things. You might get by with one REPEAT cycle in 2D, but in 3D you may need more to accomplish what you want. You may be missing some coordinate transformations to correctly position the panels in each iteration.
Other than that, is difficult to know how you want the object to work.
Best regards.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-27 10:04 AM
2015-10-27
10:04 AM
SinceV6
code posted was 2d sorry. 3D repeat code is:
if (no_pan_0-sla_pan_0)>0 then
i=1
repeat
gosub 20
addx pan_m
i= i+1
until i>(no_pan_0-sla_pan_0)
endif
the transformations to the next screen works otherwise the slatted panel would be over or further from the solid one.
I have a sub set for each type (slatted or solid) and I want the script to be able to repeat that sub for however many times it needs. So if in the future we can have a 6 panel long leg then I just change one small bit of code.
code posted was 2d sorry. 3D repeat code is:
if (no_pan_0-sla_pan_0)>0 then
i=1
repeat
gosub 20
addx pan_m
i= i+1
until i>(no_pan_0-sla_pan_0)
endif
the transformations to the next screen works otherwise the slatted panel would be over or further from the solid one.
I have a sub set for each type (slatted or solid) and I want the script to be able to repeat that sub for however many times it needs. So if in the future we can have a 6 panel long leg then I just change one small bit of code.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-27 01:55 PM
2015-10-27
01:55 PM
tlodge:
One thing to check is the subroutine 20, to make sure it is not deleting the Add command or assigning "i" a different value.
You can zip and then post the object here, debugging is much easier when the entire code and parameters can be seen.
David
One thing to check is the subroutine 20, to make sure it is not deleting the Add command or assigning "i" a different value.
You can zip and then post the object here, debugging is much easier when the entire code and parameters can be seen.
David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC28 USA • Mac mini M4 Pro OSX15 | 64 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
www.davidmaudlin.com
Digital Architecture
AC28 USA • Mac mini M4 Pro OSX15 | 64 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-27 02:07 PM
2015-10-27
02:07 PM
David
there was a repeat in the sub codes which used i. Simply changing the this to J in the 'main' script resolved the issue.
Lesson use a different letter for each Repeat.
Many Thanks
there was a repeat in the sub codes which used i. Simply changing the this to J in the 'main' script resolved the issue.
Lesson use a different letter for each Repeat.
Many Thanks