Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Profiles in GDL

Hmooslechner
Rockstar
Has anyone explored the new possibilities to implement profiles in GDL? The GDL-book does just announce it, but there is not a single example how to to it!?!

the same in:

gdl.graphisoft.com/new-features-guide/new-gdl-features-in-archicad-21
AC5.5-AC27EduAut, PC-Win10, MacbookAirM1, MacbookM1Max, Win-I7+Nvidia
20 REPLIES 20
Barry Kelly
Moderator
lukaso wrote:
Has anyone tried to put a second or third Profile into the "profile_with_tube" script?

A TUBE can only contain one profile.
It has two parts - the profile and the path.

So you either need completely new TUBE commands for each profile.
Or use "PUT" to store the profile points.
i.e. if profile 1 PUT ....
if profile 2 PUT ....
etc.

Then in the tube command "GET" the profile points, and set the path.

This way you only have the one TUBE command using the same path, but you can swap the different profiles.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Thanx Berry,

I'll give it a try

Lukas
Mac OSX - up to date

GER Archicad Full, Up to date
Pertti Paasky
Advocate
Looks like You can't save profiles' parameters to a parameter tab.
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Barry Kelly
Moderator
Pertti wrote:
Looks like You can't save profiles' parameters to a parameter tab.
I'm not quite sure what you mean.
All of the profile properties are save in the attribute for that profile.
If you need to change it then you need to edit it (or duplicate and change it) in the Profile Manager.

What is it about the profile that you are trying to save?

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru
Can you interact with the Profiles stretch regions?


Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Barry Kelly
Moderator
Lingwisyer wrote:
Can you interact with the Profiles stretch regions?


Ling.
The overall height and width - yes.
The profile (and stretch regions) should behave exactly the same as if you were manually using the profile.

As for the new profile modifiers in 22, I don't believe these can be accessed via GDL.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru
Barry wrote:
Lingwisyer wrote:
Can you interact with the Profiles stretch regions?

The overall height and width - yes.
The profile (and stretch regions) should behave exactly the same as if you were manually using the profile.

I have not been able to find out how to achieve this...



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Barry Kelly
Moderator
Lingwisyer wrote:
I have not been able to find out how to achieve this...
I haven't created my own profiled objects from scratch yet, and I assumed you could specify an overall height and width of the profile you want to use.
I was a bit wrong there.

Have a look at the profiled rail object.
This allows you to use any profile for the rail and set the overall size and width you want it to be.

It seems that you have to come up with a scaling factor based on the actual profile height (which I am sure you can get from the profile requests) and the size you want to use.
Here is a sample bit of the profile rail script showing a few pre-defined profiles.

if abs(iProfile) = PROFILE_WOOD1 then
													! mirroring irrelevant
													! script coordinates relative to top middle
	xFactor = wProfile / 0.074
	yFactor = hProfile / 0.066
	offsetY = offsetY + hProfile / 2
	yBottom = offsetY * yFactor - hProfile
endif
if abs(iProfile) = PROFILE_WOOD2 then
													! mirroring irrelevant
													! script coordinates relative to top middle
	xFactor = wProfile / 0.07146499997866
	yFactor = hProfile / 0.06114945598568
	offsetY = offsetY + hProfile / 2
	yBottom = offsetY * yFactor - hProfile
endif
if abs(iProfile) = PROFILE_WOOD3 then
													! mirroring irrelevant
												 	! script coordinates relative to bottom middle
	xFactor = wProfile / 0.05
	yFactor = hProfile / 0.01461124862507
	offsetY = (offsetY - hProfile / 2) / yFactor
	yBottom = (0 + offsetY) * yFactor
endif
if abs(iProfile) = PROFILE_WOOD4 then
													! mirroring irrelevant
												 	! script coordinates relative to bottom middle
	xFactor = wProfile / 0.085
	yFactor = hProfile / 0.06147903275841
	offsetY = (offsetY - hProfile / 2) / yFactor
	yBottom = (0 + offsetY) * yFactor
endif

So 'wProfile' and 'hProfile' are the sizes you want it to be.

Then when you PUT the profile coordinates, you multiply them by the respective 'xFactor' & 'yFactor'.
This should change the size of the profile without altering the path.


Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator
I just had a quick play with the tube object that was attached in an earlier post.
Seems the scale factor works fine on a rectangular profile, but not so well on a curved profile.


Obviously the curves need to be handled differently.

The "Rail 21/22" does this OK for the pre-defined profiles, but it is is a little hard to dissect the Graphisoft parts sometimes.
It is all in there somewhere though.

But maybe that is the trick - these are pre-defined profiles.

The "Profiled Rail 21/22" uses user defined profiles (from the profile manager) but it seems these can not be resized.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru
Yeah, I figured I could scale them based on their bounding box, but I was hoping it could be restricted to the stretch boundaries instead of uniformly. Oh well, we will just have to put up with stretching the profiles manually in the manager.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660