Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Renovation status and 3D?

Mats_Knutsson
Advisor
Hi,
I have 2D-symbols controlled by renovation status but I seem not able to do the same in 3D!?

This is my MASTERSCRIPT:
renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)
pen 1

This is my 2D (just an example):
if renoStatus = "Existing" then RECT2 0,0,10,10 
if renoStatus = "New" then CIRCLE2 0,0,10
if renoStatus = "To Be Demolished" then LINE2 0,0,10,10

I tried various if-then-gosubs etc in 3D but didn't get it to work at all:
if renoStatus = "Existing" gosub 100:
if renoStatus = "New" gosub 200: 
if renoStatus = "To Be Demolished" gosub 300:
END
100:
BLOCK 100,100,100
RETURN
200:
CYLIND 100,20
RETURN
300:
SPHERE 50
RETURN
Any clever clue?
Cheers,
Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
5 REPLIES 5

A_ Smith
Enthusiast
Mats_Knutsson wrote:
renoStatus = ""
_r = APPLICATION_QUERY ("OwnCustomParameters", "GetParameter(Renovation.RenovationStatus)", renoStatus)
pen 1

This is my 2D (just an example):
if renoStatus = "Existing" then RECT2 0,0,10,10 
if renoStatus = "New" then CIRCLE2 0,0,10
if renoStatus = "To Be Demolished" then LINE2 0,0,10,10

I tried various if-then-gosubs etc in 3D but didn't get it to work at all:
if renoStatus = "Existing" THEN gosub 100: !you don't need that colon here, unless you want to add code in a same row
if renoStatus = "New" THEN gosub 200: 
if renoStatus = "To Be Demolished" THEN gosub 300:
END
100:
BLOCK 100,100,100
RETURN
200:
CYLIND 100,20
RETURN
300:
SPHERE 50
RETURN

i didn't try if it works, but i see you're missing then....
AC 22, 24 | Win 10

Peter Baksa
Graphisoft
Graphisoft
This query doesn't work in 3D, we will update the manual.

As a habit, always check the return value of REQUEST, LIBRARYGLOBAL, APPLICATION_QUERY commands, there might be more complex situations where a piece of information can't be read.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Mats_Knutsson
Advisor
Peter wrote:
This query doesn't work in 3D, we will update the manual.

As a habit, always check the return value of REQUEST, LIBRARYGLOBAL, APPLICATION_QUERY commands, there might be more complex situations where a piece of information can't be read.
Hi Peter,
Doesn't work as in impossible? Can I solve this another way? Like creating a dummy variable getting its values from the 2D-enabled query? Thing is our landscaping department is growing like crazy and if they are going to use Archicad more in the future we need some basic things like this... existing tree, to be demolisherdtree, new tree etc. It would be nice to use Renovation filters for this.
Br,
Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.

runxel
Ace
Peter wrote:
This query doesn't work in 3D, we will update the manual.

Mh excuse me?

How about rather updating your software and make things work? GDL has become a nightmare and inconsistent mess.
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Peter Baksa
Graphisoft
Graphisoft
Sorry, my communication was lazy. I notified product managment about this wish. The problem isn't renovation-specific, the "OwnCustomParameters"/"ParentCustomParameters" queries don't work in 3D, which we can't fix in the next release, so a note will be added to the manual.
The availability of REQUEST and APPLICATION_QUERY results are beyond GDL, often an optimization/speed/teamwork issue is involved when something isn't available. I understand it would be nice if GDL objects could modify their model based on the renovation status, but that would go against the filter concept.

What are you trying to do in 3D that is renovation status-specific?

There is no other way currently to get the renovation status in GDL, but there may be a workaround.
Labels placed on sections/elevations are executed as 2D, they can access the labelled element's renovation status with "ParentCustomParameters". Labels can draw too, but their positioning is not done by AC. If you want to draw at the position where the label was placed, the user has to turn off the pointer (this can't be done by GDL). At the beginning of the script, use this transformation to move the origin to the place of the click:
add2 LABEL_POSITION[2][1] + LABEL_POSITION[3][1],
     LABEL_POSITION[2][2] + LABEL_POSITION[3][2]
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!