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

GDL: Multiple Complex Profiles

Lingwisyer
Guru
Hi all,

Anyone know how to get multiple complex profiles to work within a single object? So far when I try to add a second profile, changing the relevant request definitions, the first profile breaks...



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 
14 REPLIES 14
Nader Belal
Mentor
Hi there,

I will post the answer in GDL-forum.

If you're talking about saving your profiles in GDL, the best way I have found and based on the image you have posted is to save their vertices coordinates in the Master Script is by using arrays and parameter buffer, in that case you will only have to be careful but the differences between using "use" and "get".

best regards,
😉
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Lingwisyer
Guru
I figured out how to do it last week but looks like I forgot to update here. I believe that my issue was all of the variables that needed to be modified resulting in missing or conflicting variables.

!!! Pull Complex Profile !!!

COMPTYPE_CORE = 0
COMPTYPE_FINISH = 1
COMPTYPE_OTHER = 2


if GLOB_SCRIPT_TYPE = 2 or GLOB_SCRIPT_TYPE = 3 or GLOB_SCRIPT_TYPE = 5 then
	_nComponents = 0
	dim _componentTypes[]

	n = REQUEST{2} ("Profile_components", myProfileIdx, _nComponents, _componentTypes)

	n2 = REQUEST ("Profile_default_boundingbox",  myProfileIdx, _xMin, _yMin, _xMax, _yMax)

	n3 = REQUEST{4} ("Profile_component_info", myProfileIdx, _nComponents, "gs_profile_surface", bMat_profile)

	If rafPro = "Complex" then
			ProWidth = abs(_xMax - _xMin)
			ProHeight = abs(_yMax - _yMin)
			SquareV2 = ProHeight / ( cos(phi) )
	endIf

	if n then
		dim _bShowPart[]
		_needRequestDetails = 0
	
		for _i = 1 to _nComponents
			_bShowPart[_i] = 1    
			  if GLOB_STRUCTURE_DISPLAY = 1 AND _componentTypes[_i] <> COMPTYPE_CORE then _bShowPart[_i] = 0   ! GLOB_STRUCTURE_DISPLAY: 0 – entire structure, 1 – core only, 2 – without finishes
			  if GLOB_STRUCTURE_DISPLAY = 2 AND _componentTypes[_i] = COMPTYPE_FINISH then _bShowPart[_i] = 0
			  if _bShowPart[_i] then _needRequestDetails = 1
		next _i
	
		if _needRequestDetails then
			dim _profileGeometryRawData[]
			n = REQUEST ("Profile_default_geometry", myProfileIdx, _profileGeometryRawData)		! n1, n2, ..., nn, x11, y11,s11 
	
			dim _contStartPoints[]
			dim _contEndPoints[]
			_contStartPoints[1] = _nComponents + 1
			for _i = 2 to _nComponents
				_contStartPoints[_i] = _contStartPoints[_i - 1] + _profileGeometryRawData[_i - 1] * 5
				_contEndPoints[_i-1] = _contStartPoints[_i] - 1
			next _i
			_contEndPoints[_nComponents] = vardim1(_profileGeometryRawData)
		endif
	endif
endif



!!! Pull Complex Profile 2 !!!

if GLOB_SCRIPT_TYPE = 2 or GLOB_SCRIPT_TYPE = 3 or GLOB_SCRIPT_TYPE = 5 then
	_nComponents2 = 0
	dim _componentTypes2[]

	n = REQUEST{2} ("Profile_components", myProfileIdx2, _nComponents2, _componentTypes2)

	n2 = REQUEST ("Profile_default_boundingbox",  myProfileIdx2, _xMin2, _yMin2, _xMax2, _yMax2)

	if n then
		dim _bShowPart2[]
		_needRequestDetails = 0
	
		for _i2 = 1 to _nComponents2
			_bShowPart2[_i2] = 1    
			  if GLOB_STRUCTURE_DISPLAY = 1 AND _componentTypes2[_i2] <> COMPTYPE_CORE then _bShowPart2[_i2] = 0   ! GLOB_STRUCTURE_DISPLAY: 0 – entire structure, 1 – core only, 2 – without finishes
			  if GLOB_STRUCTURE_DISPLAY = 2 AND _componentTypes2[_i2] = COMPTYPE_FINISH then _bShowPart2[_i2] = 0
			  if _bShowPart2[_i2] then _needRequestDetails = 1
		next _i2
	
		if _needRequestDetails then
			dim _profileGeometryRawData2[]
			n = REQUEST ("Profile_default_geometry", myProfileIdx2, _profileGeometryRawData2)		! n1, n2, ..., nn, x11, y11,s11 
	
			dim _contStartPoints2[]
			dim _contEndPoints2[]
			_contStartPoints2[1] = _nComponents2 + 1
			for _i2 = 2 to _nComponents2
				_contStartPoints2[_i2] = _contStartPoints2[_i2 - 1] + _profileGeometryRawData2[_i2 - 1] * 5
				_contEndPoints2[_i2-1] = _contStartPoints2[_i2] - 1
			next _i2
			_contEndPoints2[_nComponents2] = vardim1(_profileGeometryRawData2)
		endif
	endif
endif

Saving some profiles in GDL would be a good next step, but a bit extra at the moment.



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 
Nader Belal
Mentor
I see that you didn't specify that you need to extract complex profile geometries when you asked the question
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Lingwisyer
Guru
Assumption based on my image of two extruded profiles, one of which had failed to generate properly...

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Hmooslechner
Rockstar
Why not drawing all the forms into one single profile?
AC5.5-AC27EduAut, PC-Win10, MacbookAirM1, MacbookM1Max, Win-I7+Nvidia
Nader Belal
Mentor
@Hmooslechner,

Future maintenance and change by the manufacturer.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
Lingwisyer
Guru
Flexibility of use. Object in image was scripted with duplication and offset for simplicity of testing.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Hmooslechner
Rockstar
the coding for getting a single profile seems to be "huge" - has anyone of You figured out, how to get it much simpler?

I thought about using profiles in windows-script, but there has to be much more profiles - not only one or two.

Ok - You can copy-paste the code for each extra profile and then rename all the variable-names for each new - but is there really no way to get this simpler?
AC5.5-AC27EduAut, PC-Win10, MacbookAirM1, MacbookM1Max, Win-I7+Nvidia
Lingwisyer
Guru
Could you possibly loop it with a running array or buffer, then pull the desired profiles referencing the array or buffer? Max value being how ever many myProfileIdx[ ] you decided to include in your parameter list.



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