Skip to content

Commit

Permalink
Better naming for definitions (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankoral authored Jul 16, 2024
1 parent 22497c8 commit 1123054
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
applicationId = definitionId.ToString(),
Objects = new(),
MaxDepth = depth,
["name"] = definition.Name,
Name = definition.Name,
["comments"] = definition.Comments,
["units"] = definition.Units // ? not sure needed?
};
Expand Down Expand Up @@ -168,15 +168,8 @@ public BakeResult BakeInstances(

var record = new BlockTableRecord();
var objectIds = new ObjectIdCollection();
record.Name = baseLayerName;
if (definitionProxy["name"] is string name)
{
record.Name += name;
}
else
{
record.Name += definitionProxy.applicationId;
}
// We're expecting to have Name prop always for definitions. If there is an edge case, ask to Dim or Ogu
record.Name = $"{definitionProxy.Name}-({definitionProxy.applicationId})-{baseLayerName}";

foreach (var entity in constituentEntities)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
applicationId = instanceDefinitionId,
Objects = new List<string>(),
MaxDepth = depth,
["name"] = instance.InstanceDefinition.Name,
Name = instance.InstanceDefinition.Name,
["description"] = instance.InstanceDefinition.Description
};

Expand Down Expand Up @@ -168,7 +168,7 @@ public BakeResult BakeInstances(
}

// POC: Currently we're relying on the definition name for identification if it's coming from speckle and from which model; could we do something else?
var defName = $"{baseLayerName} ({definitionProxy.applicationId})";
var defName = $"{definitionProxy.Name}-({definitionProxy.applicationId})-{baseLayerName}";
var defIndex = doc.InstanceDefinitions.Add(
defName,
"No description", // POC: perhaps bring it along from source? We'd need to look at ACAD first
Expand Down

0 comments on commit 1123054

Please sign in to comment.