DIe Hilfe sagt das folgende...
Die ID eines Attributes anhand der Bezeichnung kann mit einem Request gefunden werden.
Get_String(ID)
Extracts a string by specified ID from resource DLL
Syntax
my_string = GET_STRING (4711)
print GET_STRING (4711)
TEXT2 0 , 0 , GET_STRING (4711)
Usable since script version 2.1 (Allplan 2015-0).
attr_ID(idx)
ATTR_ID returns the attribute id.
Syntax
ATTR_ID(idx)
idx(numeric): index of attribute (first attribute has index of 1)
return : attribute id (integer)
Usable since script version 3.0 (Allplan 2018-0).
Request...
REQUEST queries values or the status of the program or the SmartPart and stores the answers in variables. The return value of REQUEST is the number of answers found.
Syntax
REQUEST (question_text, question_object, variable1 [, variable2,...])
Parameter
question_text (string): represents the question, the valid questions are predefined (see below)
question_object (string or numeric): the object which is queried
variable1,...,variablen: name of variables for storing the answers.
List of valid questions:
Reg_Key: returns the string value of a registry key.
Path_Name: returns the path of Allplan installation directories. Example: REQUEST ("Path_Name", path_type, path), where path_type can be "User", "Extern", Temp".
Reinf_Bar_Diam_List: returns the possible bar diameters in current unit.
Reinf_Bend_Roll_List: returns the possible bending role factors.
Reinf_Default_Norm_ID: returns the ID of the current reinforcement norm.
Reinf_Default_Conr_Grade_ID: returns the ID of the current concrete grade.
Reinf_Default_Norm_ID: returns the ID of the current reinforcement norm.
Reinf_Default_Hook_Length: returns the default hook length and the minimal hook length.
Reinf_Default_Overlapping_Length: returns the default overlapping length.
Reinf_Language: returns the ID of the current Allplan language.
Reinf_Bar_Grade: returns the properties of the steel grade.
Reinf_Bar_Diam: returns the properties of the bar.
Reinf_Norm: returns the name of the norm.
Reinf_Concr_Grade: returns the properties of the concrete grade.
Reinf_Steel_Grade: returns the name of the steel grade.
Reinf_Mesh_Group: returns the name of the steel mesh.
Reinf_Min_Bend_Roll: returns the minimal bending roll factor.
Reinf_Mesh: returns the properties of the mesh.
Name_of_program: queries the name of the program and stores its value in a variable. Example: REQUEST ( "name_of_program" , "" , name ) stores the name of the program ("Allplan") in the variable 'name'.
Name_of_macro: queries the name of the SmartPart and stores its value in a variable.
Name_of_main: queries the name of the main subscript and stores its value in a variable (empty, if main subscript doesn't exist).
Height_of_style: queries the total height of the style measured in millimeters (height in meters is height / 1000 * GLOB_SCALE); the descent (the distance in millimeters from the text base line to the descent line) and the leading (the distance in millimeters from the descent line to the ascent line). Example: REQUEST ("height_of_style", name, height [, descent, leading])
Fontnames_list: queries the names of the available fonts (including character coding). The list or part of thereof can be used together with VALUES for a selection of fonts. The syntax is REQUEST ("FONTNAMES_LIST", type, fontnames), with 4 possible values for 'type':
type="Standard": only Allplan fonts
type="System": only Windows fonts
type="Predefined": a subset of Windows fonts
type="All": all fonts (Windows and Allplan)
DateTime: queries the current date and time.
Available formats are:
%a: short name of weekday (e.g. Tue)
%A: full name of weekday (e.g. Tuesday)
%b: short name of month (e.g. Oct)
%B: full name of month (e.g. October)
%c: date and time formatted like: 01:35:56 PM Tuesday, October 04, 2011
%d: day of month as integer number (e.g 04)
%H: hour (24) as integer number (e.g. 14)
%I: hour (12) as integer number (e.g. 02)
%j: day of the year as integer number (e.g. 277)
%m: month of the year as integer number (e.g. 10)
%M: minute as integer number (e.g. 59)
%S: second as integer number (e.g. 59)
%U: number of the week as integer number, with Sunday as first day of the week (00-53)
%w: weekday as integer number (Sunday=0, Saturday=6)
%W: number of the week as integer number with Monday as first day of the week (00-53)
%x: date formatted as: (e.g. 10/04/2011)
%X: time formatted as: 01:35:56
%y: year without century as integer number (e.g. 11)
%Y: year with century as integer number (e.g. 2011)
%Z: time zone as string
%%: the % character
id_of_color: queries the color-id of the object defined hereafter.
Eligible objects are:
aux_cons: color of auxiliary construction
handle: color of normal handles
handle_select: color of selected handle
handle_active: color of active handles
selection: color of selected objects
layer_attr: queries the layer settings for pen, stroke and color.
attribute_enum_values: returns a list of enum values and named values of an enum attribute (0, string_val1, 1, string_val2, ...i, string_vali)
Example:
n=REQUEST("layer_attr",lyr_id,pn,st,cl)
lyr_id: number of layer
pn: number of pen (return value)
st: number of stroke (return value)
cl: number of color (return value)
Usable since script version 1.1 (Allplan 2012-1).
attribute_enum_values: queries the enum values and value strings of enum attribute
attribute_id: queries the attribute id for a given name
attribute_type: queries the attribute type for a given id (1=STRING, 2=INTEGER, 3=REALNUM, 4=ENUM, 5=DATE)
attribute_name: queries the attribute name for a given id
attribute_ids_list: queries the available attribute id's for given type
attribute_names_list: queries the available attribute names for given type
Usable since script version 3.0 (Allplan 2018-0).