IF-OR-THEN Statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 04:43 AM
I appear to be unable to create an
If _clean = 1 then If GLOB_VIEW_TYPE = 4 or 5 then _status = 8 else _status = 15 endIf endIf
I would rather not need to duplicate the statement for each case...
Ling.
AC22-28 AUS 3001 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 06:53 PM
If _clean = 1 then If (GLOB_VIEW_TYPE = 4 or GLOB_VIEW_TYPE = 5) then _status = 8 else _status = 15 endIf endIf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 04:56 AM
It is view dependent so won't work in parameter (master) or property scripts.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 05:18 AM
If I put just one of the views it works fine in the Master.
Ling.
AC22-28 AUS 3001 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 06:22 AM
It may seem OK when you are looking at your object in 2D or 3D as the master script is run before the 2D and 3D scripts.
But it is also run before the parameter script is run so if you are adjusting parameters it may return the wrong values.
The master script is run many times when you interact with an object.
It is better to just be in the 2D and/or 3D scripts.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 06:53 PM
If _clean = 1 then If (GLOB_VIEW_TYPE = 4 or GLOB_VIEW_TYPE = 5) then _status = 8 else _status = 15 endIf endIf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-30 03:01 AM
If _clean = 1 then _status = 8 PARAMETERS _status = 8 else _status = 15 PARAMETERS _status = 15 endIf
I can get the parameter to change by using that in the
Ling.
AC22-28 AUS 3001 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-30 04:20 AM
Lingwisyer wrote:Remember GLOB_VIEW_TYPE is view dependant so will not work in the master script when it is run as the parameter script (i.e. you can not set the parameter).
I can get the parameter to change by using that in theParameter Script, but am unable to link it to the view type...
And of course you can not set the parameters from the 2D or 3D scripts either.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-30 04:42 AM
Ling.
AC22-28 AUS 3001 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-30 06:55 AM
You can only set the parameter from the master or parameter script, but you can't use GLOB_VIEW_TYPE there.
So you will have to determine the GLOB_VIEW_TYPE at the beginning of the 2D and 3D script to set your status code.
The following parts of those scripts can then use that status code - but you will never see it as a parameter if that is what you are trying to do.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-30 10:08 AM
If _clean = 1 then If (GLOB_VIEW_TYPE = 4 or GLOB_VIEW_TYPE = 5) then status = 8 else _status = 15 endIf
The following section returns an error about an undefined variable.
cprism_ louvtopmat, louvbotmat, louvsidemat, 5, gs_louvre_thk, -a / 2 + gs_fw_side_right + gs_int_fw, -(gs_louvre_width) / 2, _status, -a / 2 + gs_fw_side_right + gs_int_fw, (gs_louvre_width) / 2, _status, a / 2 - gs_fw_side_left - gs_int_fw, (gs_louvre_width) / 2, _status, a / 2 - gs_fw_side_left - gs_int_fw, -(gs_louvre_width) / 2, _status, -a / 2 + gs_fw_side_right + gs_int_fw, -(gs_louvre_width) / 2, -1
Even if I put "_status = 15" at the start, it will say that it is undefined and will not generate the relevant parts properly... It effectively uses "_status = 0". If I define it in the parameters, then it will use that instead...
Ling.
AC22-28 AUS 3001 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |