License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

Override rules creation

Anonymous
Not applicable
Hi,

I am digging in the Override_Test example project to see what the API lets us do in this field.
I am very surprised to realize that rules creation implies creating manually then saving their criterions as an XML string.
API_OverrideRule rule;
	rule.name = "Transparent surface for Windows and Doors";

	// NOTE: to get the proper criterion XML, go to ARCHICAD and save the wanted override rule as XML
	// Criterion XML: Element Type is Window or Door
	rule.criterionXML =
		"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>"
		"<CriterionExpression Mv=\"2\" Sv=\"1\">"
			"<TextMatchType>1</TextMatchType>"
			"<Size>1</Size>"
			"<ClassGuid>C6EBD1BD-7702-46FF-8ED9-9CC37648A7C7</ClassGuid>"
			"<CompositeCriterion Mv=\"2\" Sv=\"1\">"
				"<LogicalOperator>2</LogicalOperator>"
				"<CriteriaCount>1</CriteriaCount>"
				"<ClassGuid>C6EBD1BD-7702-46FF-8ED9-9CC37648A7C7</ClassGuid>"
				"<CompositeCriterion Mv=\"2\" Sv=\"1\">"
					"<LogicalOperator>1</LogicalOperator>"
					"<CriteriaCount>2</CriteriaCount>"
					"<ClassGuid>B4B7B134-EC56-4D40-8D4C-71D7C5A2493A</ClassGuid>"
					"<ElemTypeCriterion Mv=\"2\" Sv=\"3\">"
						"<VBEF::CritToolType Mv=\"1\" Sv=\"0\">"
							"<ElemRegistryRefId>1464421956</ElemRegistryRefId>"
							"<ElemCreatorToolUnID>"
								"<MainGuid>4ABD0A6E-634B-4931-B3AA-9BEE01F35CDF</MainGuid>"
								"<RevGuid>5585F21A-DE1C-164C-A64E-92CB48F79FA5</RevGuid>"
							"</ElemCreatorToolUnID>"
						"</VBEF::CritToolType>"
						"<LogicalOperator>1</LogicalOperator>"
					"</ElemTypeCriterion>"
					"<ClassGuid>B4B7B134-EC56-4D40-8D4C-71D7C5A2493A</ClassGuid>"
					"<ElemTypeCriterion Mv=\"2\" Sv=\"3\">"
						"<VBEF::CritToolType Mv=\"1\" Sv=\"0\">"
							"<ElemRegistryRefId>1146048338</ElemRegistryRefId>"
							"<ElemCreatorToolUnID>"
								"<MainGuid>11E85B84-8DD1-491B-A2FE-337454A91545</MainGuid>"
								"<RevGuid>91A61E93-32A8-BC46-A11A-5FB89256C651</RevGuid>"
							"</ElemCreatorToolUnID>"
						"</VBEF::CritToolType>"
						"<LogicalOperator>1</LogicalOperator>"
					"</ElemTypeCriterion>"
				"</CompositeCriterion>"
			"</CompositeCriterion>"
		"</CriterionExpression>";
I wanted to create this kind of "filters" automatically in my add-on.

Thanks for your ideas.
12 REPLIES 12
Anonymous
Not applicable
Hi,

I am writing to know if someone in ArchiCAD development team would be able to give us a description of how the criterionXML string used in
typedef struct {
	API_Guid						guid;
	GS::UniString					name;
	API_OverrideRuleStyle			style;
	GS::UniString					criterionXML;
} API_OverrideRule;
is computed.

I cannot imagine you don't have a document describing this. Without a mean to programmatically describe a rule criterion, I really don't see what's the point to give access to some functions like ACAPI_Override_CreateOverrideRule.

Thanks in advance for your help.

Maxime
Laszlo Nagy
Community Admin
Community Admin
Just to let you know, both Regina and Akos are from GRAPHISOFT and are in the ARCHICAD Development team. You can see the "GRAPHISOFT" text next to their User Name.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Anonymous
Not applicable
Thank you for your observation.

So can anyone from Graphisoft, whoever he/she is, help me regarding this ?