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

Modify value of layout ID

Anonymous
Not applicable
Hi,

I'm building a simple 2D-object. I want it to be placed on a floor plan and I want it to show the value of the layout-ID when shown on a layout. The thing is that i only want it show part of the layout-ID (like the 4 first letters)

As far as i know I can´t use the auto text - <LAYOUTID> - command since the retrieved value can't be modified.

I´ve been working around with

n = REQUEST ("HomeDB_info", "", homeDBIntId, homeDBUserId, homeDBName, homeContext)

but can´t make it work.

Does anyone have an idea of how to solve this?
4 REPLIES 4
Podolsky
Ace
What exactly does not work? To get Layout ID from "HomeDB_info" request you need to use homeDBUserID.
And after to use string modification command (STRSUB)

Something like that:

n = REQUEST ("HomeDB_info", "", homeDBIntId, homeDBUserId, homeDBName, homeContext)
IF homeContext=5 THEN
_LayoutID=homeDBUserId
My_LayoutID=STRSUB (My_LayoutID, 1, 4)
text2 0,0, My_LayoutID
ENDIF

If this script is not working - maybe ArchiCAD passes to _LayoutID number value instead of string. Then convert it to the string (using STR command) prior using it in STRSUB.
Fredrikcastilla
Newcomer
The object is to be placed on a floor plan so the returned value when using

n = REQUEST ("HomeDB_info", "", homeDBIntId, homeDBUserId, homeDBName, homeContext)

will be similar to the value returned when using

n = REQUEST ("Home_story", "", index, story_name)

When using <LAYOUTID> the returned value will be the ID of any arbitrary layout within in which the object is displayed even though the object is placed on a floor plan.

So what I'm aiming at is to somehow request the ID of any arbitrary layout in which the object will be showed and then modify that value.
AC 21- Imac - MacOS Sierra
JGoode
Advocate
Just to clarify, are you looking to create an object where you place it in floor plan but it automatically displays which layout it is on when opened in a layout? So a single object in floor plan would show 0001 or 0002 if those were the layouts you opened them in?

I'm not sure this is possible
ArchiCAD 23

Windows 10
Fredrikcastilla
Newcomer
JGoode wrote:
Just to clarify, are you looking to create an object where you place it in floor plan but it automatically displays which layout it is on when opened in a layout? So a single object in floor plan would show 0001 or 0002 if those were the layouts you opened them in?

I'm not sure this is possible
Yes, that's exactly what I mean. It would behave like the autotext but with the possibility to modify the value.
AC 21- Imac - MacOS Sierra