-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into FilterElements
- Loading branch information
Showing
14 changed files
with
2,646 additions
and
2,402 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
archicad-addon/Examples/get_building_material_physical_properties.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import json | ||
import aclib | ||
|
||
buildMats = aclib.RunCommand ('API.GetAttributesByType', { 'attributeType' : 'BuildingMaterial' }) | ||
print (buildMats) | ||
|
||
commandName = 'GetBuildingMaterialPhysicalProperties' | ||
commandParameters = buildMats | ||
|
||
print ('Command: {commandName}'.format (commandName = commandName)) | ||
print ('Parameters:') | ||
print (json.dumps (commandParameters, indent = 4)) | ||
|
||
response = aclib.RunTapirCommand (commandName, commandParameters) | ||
print ('Response:') | ||
print (json.dumps (response, indent = 4)) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#include "DeveloperTools.hpp" | ||
|
||
#include "SchemaDefinitions.hpp" | ||
|
||
#include "File.hpp" | ||
|
||
CommandInfo::CommandInfo (const GS::UniString& name, const GS::UniString& description, const GS::UniString& version, const GS::Optional<GS::UniString>& inputScheme, const GS::Optional<GS::UniString>& outputScheme) : | ||
name (name), | ||
description (description), | ||
version (version), | ||
inputScheme (inputScheme), | ||
outputScheme (outputScheme) | ||
{ | ||
} | ||
|
||
CommandGroup::CommandGroup (const GS::UniString& name) : | ||
name (name), | ||
commands () | ||
{ | ||
} | ||
|
||
static bool WriteStringToFile (const IO::Location& location, const GS::UniString& content) | ||
{ | ||
IO::File file (location, IO::File::OnNotFound::Create); | ||
if (file.Open (IO::File::OpenMode::WriteEmptyMode) != NoError) { | ||
return false; | ||
} | ||
|
||
std::string contentString (content.ToCStr (CC_UTF8).Get ()); | ||
if (file.WriteBin ((char*) contentString.c_str (), (GS::USize) contentString.size ()) != NoError) { | ||
return false; | ||
} | ||
|
||
file.Close (); | ||
return true; | ||
} | ||
|
||
void GenerateDocumentation (const IO::Location& folder, const std::vector<CommandGroup>& commandGroups) | ||
{ | ||
static const GS::UniString NullString ("null"); | ||
IO::Location commonSchemaLocation = folder; | ||
commonSchemaLocation.AppendToLocal (IO::Name ("common_schema_definitions.js")); | ||
GS::UniString commonSchemaContent = "var gSchemaDefinitions = " + GetCommonSchemaDefinitions () + ";"; | ||
WriteStringToFile (commonSchemaLocation, commonSchemaContent); | ||
|
||
IO::Location commandDefinitionLocation = folder; | ||
commandDefinitionLocation.AppendToLocal (IO::Name ("command_definitions.js")); | ||
GS::UniString commandDefinitionContent = "var gCommands = ["; | ||
for (size_t groupIndex = 0; groupIndex < commandGroups.size (); groupIndex++) { | ||
const CommandGroup& group = commandGroups[groupIndex]; | ||
GS::UniString groupCommandsContent; | ||
for (size_t commandIndex = 0; commandIndex < group.commands.size (); commandIndex++) { | ||
const CommandInfo& command = group.commands[commandIndex]; | ||
groupCommandsContent += GS::UniString::Printf (R"({ | ||
"name": "%T", | ||
"version": "%T", | ||
"description": "%T", | ||
"inputScheme": %T, | ||
"outputScheme": %T | ||
})", | ||
command.name.ToPrintf (), | ||
command.version.ToPrintf (), | ||
command.description.ToPrintf (), | ||
command.inputScheme.HasValue () ? command.inputScheme.Get ().ToPrintf () : NullString.ToPrintf (), | ||
command.outputScheme.HasValue () ? command.outputScheme.Get ().ToPrintf () : NullString.ToPrintf () | ||
); | ||
if (commandIndex < group.commands.size () - 1) { | ||
groupCommandsContent += ","; | ||
} | ||
} | ||
commandDefinitionContent += GS::UniString::Printf (R"({ | ||
"name": "%T", | ||
"commands": [%T] | ||
})", | ||
group.name.ToPrintf (), | ||
groupCommandsContent.ToPrintf () | ||
); | ||
if (groupIndex < commandGroups.size () - 1) { | ||
commandDefinitionContent += ","; | ||
} | ||
} | ||
commandDefinitionContent += "];"; | ||
WriteStringToFile (commandDefinitionLocation, commandDefinitionContent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include "MigrationHelper.hpp" | ||
#include "CommandBase.hpp" | ||
|
||
#include "UniString.hpp" | ||
#include "Location.hpp" | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
class CommandInfo | ||
{ | ||
public: | ||
CommandInfo (const GS::UniString& name, const GS::UniString& description, const GS::UniString& version, const GS::Optional<GS::UniString>& inputScheme, const GS::Optional<GS::UniString>& outputScheme); | ||
|
||
GS::UniString name; | ||
GS::UniString description; | ||
GS::UniString version; | ||
GS::Optional<GS::UniString> inputScheme; | ||
GS::Optional<GS::UniString> outputScheme; | ||
}; | ||
|
||
class CommandGroup | ||
{ | ||
public: | ||
CommandGroup (const GS::UniString& name); | ||
|
||
GS::UniString name; | ||
std::vector<CommandInfo> commands; | ||
}; | ||
|
||
void GenerateDocumentation (const IO::Location& folder, const std::vector<CommandGroup>& commandGroups); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#pragma once | ||
|
||
#define ID_ADDON_INFO 32000 | ||
#define ID_ADDON_INFO_NAME 1 | ||
#define ID_ADDON_INFO_DESC 2 | ||
#define ID_ADDON_INFO 32000 | ||
#define ID_ADDON_INFO_NAME 1 | ||
#define ID_ADDON_INFO_DESC 2 | ||
|
||
#define ID_ADDON_ID 32500 | ||
#define ID_ADDON_MENU 32001 | ||
#define ID_ADDON_MENU_GENERATE_DOC 1 | ||
|
||
#define ID_ADDON_ID 32500 |
Oops, something went wrong.