本文整理汇总了C#中FamilySymbol.GetEntity方法的典型用法代码示例。如果您正苦于以下问题:C# FamilySymbol.GetEntity方法的具体用法?C# FamilySymbol.GetEntity怎么用?C# FamilySymbol.GetEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FamilySymbol
的用法示例。
在下文中一共展示了FamilySymbol.GetEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StorageExists
//-----------------------------------
public bool StorageExists(FamilySymbol titleblock)
{
IList<Schema> schemas = Schema.ListSchemas();
foreach (Schema schema in schemas)
{
try
{
Entity entity = titleblock.GetEntity(schema);
if (entity.IsValid())
{
return true;
}
}
catch { }
}
return false;
}
示例2: RetrieveData
public void RetrieveData(FamilySymbol titleblock)
{
string[] objects = new string[9];
Schema schema = Schema.Lookup(new Guid("1a68d420-96dd-44aa-a1de-000774a6104b"));
// get the field from the schema
Field field_titleblockName = schema.GetField("titleblockName");
Field field_cellSizeDistance_X = schema.GetField("cellSizeDistance_X");
Field field_lowerGap_X = schema.GetField("lowerGap_X");
Field field_additionalEdge_X = schema.GetField("additionalEdge_X");
Field field_fineTune_X = schema.GetField("fineTune_X");
Field field_cellSizeDistance_Y = schema.GetField("cellSizeDistance_Y");
Field field_lowerGap_Y = schema.GetField("lowerGap_Y");
Field field_additionalEdge_Y = schema.GetField("additionalEdge_Y");
Field field_fineTune_Y = schema.GetField("fineTune_Y");
Field field_cellGrid_Length = schema.GetField("cellGrid_Length");
Field field_cellGrid_Height = schema.GetField("cellGrid_Height");
// get the data back from the titleblock
Entity retrievedEntity = titleblock.GetEntity(schema);
string retrievedData_titleblockName = retrievedEntity.Get<string>(schema.GetField("titleblockName"));
string retrievedData_cellSizeDistance_X = retrievedEntity.Get<string>(schema.GetField("cellSizeDistance_X"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_lowerGap_X = retrievedEntity.Get<string>(schema.GetField("lowerGap_X"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_additionalEdge_X = retrievedEntity.Get<string>(schema.GetField("additionalEdge_X"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_fineTune_X = retrievedEntity.Get<string>(schema.GetField("fineTune_X"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_cellSizeDistance_Y = retrievedEntity.Get<string>(schema.GetField("cellSizeDistance_Y"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_lowerGap_Y = retrievedEntity.Get<string>(schema.GetField("lowerGap_Y"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_additionalEdge_Y = retrievedEntity.Get<string>(schema.GetField("additionalEdge_Y"), DisplayUnitType.DUT_DECIMAL_INCHES);
string retrievedData_fineTune_Y = retrievedEntity.Get<string>(schema.GetField("fineTune_Y"), DisplayUnitType.DUT_DECIMAL_INCHES);
//string retrievedData_cellGrid = retrievedEntity.Get<string>(schema.GetField("cellGrid"));
string retrievedData_cellGrid_Length = retrievedEntity.Get<string>(schema.GetField("cellGrid_Length"));
string retrievedData_cellGrid_Height = retrievedEntity.Get<string>(schema.GetField("cellGrid_Height"));
titleblockName = retrievedData_titleblockName;
cellSizeDistance_X = retrievedData_cellSizeDistance_X;
lowerGap_X = retrievedData_lowerGap_X;
additionalEdge_X = retrievedData_additionalEdge_X;
fineTune_X = retrievedData_fineTune_X;
cellSizeDistance_Y = retrievedData_cellSizeDistance_Y;
lowerGap_Y = retrievedData_lowerGap_Y;
additionalEdge_Y = retrievedData_additionalEdge_Y;
fineTune_Y = retrievedData_fineTune_Y;
cellGrid_Length = retrievedData_cellGrid_Length;
cellGrid_Height = retrievedData_cellGrid_Height;
}