cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Mario Sacco
Expert

Store Profile data in GDL Parameters using Request

I'm trying to extract data from a profile and memorize them in the parameters of an objects using REQUEST.

It seams this option is not possible.

 

This is the code I used in parameter script.

dim geometry []
dim nnn[]
dim xx[]
dim yy[]
n = REQUEST ("Profile_default_geometry", ar_profile_type, geometry)
nnn[1] = geometry [1]

for t = 1 to nnn[1]
	xx[t] =  geometry[1+(t-1)*5+1]
	yy[t] =  geometry[1+(t-1)*5+2]
next t

parameters xx = xx
parameters yy = yy

  

Do you never have this kind of issue?

 

Operating system used: Mac Apple Silicon Sequoia

MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/
1 Solution

Accepted Solutions
AllanP
Expert

Not what you want to hear,  in the GDL manual:

Compatibility: introduced in Archicad 21.
PROFILE_DEFAULT_GEOMETRY
n = REQUEST("PROFILE_DEFAULT_GEOMETRY", name_or_index, n1, n2, ..., nm,
x11, y11, edgeVisible11, vertEdgeVisible11, additionalStatus11, ...,
x1n1, y1n1, edgeVisible1n1, vertEdgeVisible1n1, additionalStatus1n1,
x21, y21, edgeVisible21, vertEdgeVisible21, additionalStatus21, ...,
x2n2, y2n2, edgeVisible2n2, vertEdgeVisible2n2, additionalStatus2n2,
...,
xm1, ym1, edgeVisiblem1, vertEdgeVisiblem1, additionalStatusm1, ...,
xmnm, ymnm, edgeVisiblemnm, vertEdgeVisiblemnm, additionalStatusmnm)
Returns the original geometric data of the profile identified by name or index.

 

Expression returns 0 and contains dummy return values (empty string or 0) if used in parameter script (or master scripts run as parameter script), causing additional warning.

 

You can use the values in the script, but you cannot use the "Parameters" command to assign the values to the objects parameters.

I hope this is useful.

 

 

 

I have been using ArchiCAD continually since ArchiCAD 4.5
Member of Architalk since 2003, but missed the migration from Architalk to Graphisoft Communities. Melbourne, Australia

Go to post

7 Replies 7
Lingwisyer
Guru

Curious to know what is the purpose of this?

AC22-29 AUS 3200Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | 5900X | 32GB | GTX2080TI
AllanP
Expert

Not what you want to hear,  in the GDL manual:

Compatibility: introduced in Archicad 21.
PROFILE_DEFAULT_GEOMETRY
n = REQUEST("PROFILE_DEFAULT_GEOMETRY", name_or_index, n1, n2, ..., nm,
x11, y11, edgeVisible11, vertEdgeVisible11, additionalStatus11, ...,
x1n1, y1n1, edgeVisible1n1, vertEdgeVisible1n1, additionalStatus1n1,
x21, y21, edgeVisible21, vertEdgeVisible21, additionalStatus21, ...,
x2n2, y2n2, edgeVisible2n2, vertEdgeVisible2n2, additionalStatus2n2,
...,
xm1, ym1, edgeVisiblem1, vertEdgeVisiblem1, additionalStatusm1, ...,
xmnm, ymnm, edgeVisiblemnm, vertEdgeVisiblemnm, additionalStatusmnm)
Returns the original geometric data of the profile identified by name or index.

 

Expression returns 0 and contains dummy return values (empty string or 0) if used in parameter script (or master scripts run as parameter script), causing additional warning.

 

You can use the values in the script, but you cannot use the "Parameters" command to assign the values to the objects parameters.

I hope this is useful.

 

 

 

I have been using ArchiCAD continually since ArchiCAD 4.5
Member of Architalk since 2003, but missed the migration from Architalk to Graphisoft Communities. Melbourne, Australia
Mario Sacco
Expert

I want to extract the shape of a profile for a next further possibility to edit it in the objects....It is our ArchiRADAR problem to make everything complex for us in the code but simple for the users!!:-)

Screenshot 2026-06-04 alle 08.57.44.jpg

MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/
Hmooslechner
Moderator

Here my 2 ct.:

I request it in Masterscript this way - so its adressable from 2D and 3D-script later over renaming "myProfileIdx" before jumping to this function:

gosub 1000




! ==================================================================
! PROFIL-ÜBERNAHME
! ==================================================================
"Profil übernehmen":
    COMPTYPE_CORE = 0
    COMPTYPE_FINISH = 1
    COMPTYPE_OTHER = 2
    
    if GLOB_SCRIPT_TYPE = 2 or GLOB_SCRIPT_TYPE = 3 then
        _nComponents = 0
        dim _componentTypes[]
        n = REQUEST{2} ("Profile_components", myProfileIdx, _nComponents, _componentTypes)
        n2 = REQUEST ("Profile_default_boundingbox",  myProfileIdx, _xmin, _ymin, _xmax, _ymax)
    
        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   
                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)
                dim _contStartPoints[], _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
return

1000:

 Then - in 2D or here in 3D, i "make something" out of its data:

! ----------------------------------------------------------
        ! 4. HANDLAUF-SEGMENT (Zieht das Randlaufprofil)
        ! ----------------------------------------------------------
        if isOuter = 1 then
            myProfileIdx = Randlaufprofil  
            gosub "Profil übernehmen" 
            hl_versatz = -0.015
            
            if n then
                for _iComp = 1 to _nComponents
                    if _bShowPart[_iComp] then
                        dim _currSurfaces[]
                        n = REQUEST{3} ("Profile_component_info", myProfileIdx, _iComp, "gs_profile_comp_surfaces", _currSurfaces)
                        _bmat = 1 : _surface = 1 : _pen = 1
                        n = REQUEST{3} ("Profile_component_info", myProfileIdx, _iComp, "gs_profile_bmat", _bmat)
                        n = REQUEST{3} ("Profile_component_info", myProfileIdx, _iComp, "gs_profile_surface", _surface)
                        n = REQUEST{3} ("Profile_component_info", myProfileIdx, _iComp, "gs_profile_outlinepen", _pen)
                        building_material _bmat : pen _pen
            
                        _routePts = 4  
                        put (_contEndPoints[_iComp] - _contStartPoints[_iComp] + 1) / 5, _routePts, 1 + 2 + 16 + 32
            
                        _surfIdx = 1
                        for _i = _contStartPoints[_iComp] to _contEndPoints[_iComp] step 5
                            put _profileGeometryRawData[_i] - hl_versatz, _profileGeometryRawData[_i + 1], _profileGeometryRawData[_i + 2] + _profileGeometryRawData[_i + 3] + _profileGeometryRawData[_i + 4], _currSurfaces[_surfIdx] 
                            _surfIdx = _surfIdx + 1
                        next _i
            
                        tube_dx = rx2 - rx1 : tube_dy = ry2 - ry1 : tube_dz = rz2 - rz1
                        put rx1 - tube_dx,  ry1 - tube_dy,  rz1 + h_gel - tube_dz,  0 
                        put rx1,            ry1,            rz1 + h_gel,            0 
                        put rx2,            ry2,            rz2 + h_gel,            0 
                        put rx2 + tube_dx,  ry2 + tube_dy,  rz2 + h_gel + tube_dz,  0 
        
                        tube{2} _surface, _surface, _surface, get (NSP)
                    endif
                next _iComp
            endif


Thats the part for the hatches within the Profile:

 
_routePts = 4
put (_contEndPoints[_iComp] - _contStartPoints[_iComp] + 1) / 5, _routePts, 1 + 2 + 16 + 32

_surfIdx = 1
for _i = _contStartPoints[_iComp] to _contEndPoints[_iComp] step 5
put _profileGeometryRawData[_i] - hl_versatz, _profileGeometryRawData[_i + 1], _profileGeometryRawData[_i + 2] + _profileGeometryRawData[_i + 3] + _profileGeometryRawData[_i + 4], _currSurfaces[_surfIdx]
_surfIdx = _surfIdx + 1
next _i

And this is the Part for the route:

tube_dx = rx2 - rx1 : tube_dy = ry2 - ry1 : tube_dz = rz2 - rz1
put rx1 - tube_dx, ry1 - tube_dy, rz1 + h_gel - tube_dz, 0
put rx1, ry1, rz1 + h_gel, 0
put rx2, ry2, rz2 + h_gel, 0
put rx2 + tube_dx, ry2 + tube_dy, rz2 + h_gel + tube_dz, 0

So - the data for the profile-hatches is "insorted" in the memory-stack with "put" und used from there with "get".

If You alter some of this coordinates before using it with "put" for the profile for the tube with some editable hotspots or adding some other variables to this coordinates - this should solve your issue.


My example is from here: AC29EduAut - a "stairway" through all needed storeys at once.
https://www.dropbox.com/scl/fi/qjxgpui280vht0wy6j1v8/TreppeDuchAlleGescho-e_K.pln?rlkey=58krdww7nzt4...

german.
https://www.youtube.com/watch?v=jopu13MEEQk

 

AC5.5-AC27EduAut, PC-Win10, MacbookAirM1, MacbookM1Max, Win-I7+Nvidia
Lingwisyer
Guru

You cannot put the information into a parameter though, but you can request the x/y min/max to have a user comparison value to scale against.

AC22-29 AUS 3200Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | 5900X | 32GB | GTX2080TI

The only way to get the "not working in parameters script" requests data into usable parameters is to pass it through the text file, write the content in UI script, and load in master/parameter script.

Lingwisyer
Guru

You would have to select the profile, close the object, then reopen it to get it to read?

AC22-29 AUS 3200Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | 5900X | 32GB | GTX2080TI

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!