本文整理汇总了C#中SchemaBuilder.SetApplicationGUID方法的典型用法代码示例。如果您正苦于以下问题:C# SchemaBuilder.SetApplicationGUID方法的具体用法?C# SchemaBuilder.SetApplicationGUID怎么用?C# SchemaBuilder.SetApplicationGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchemaBuilder
的用法示例。
在下文中一共展示了SchemaBuilder.SetApplicationGUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateInitialParameters
// Setup routine: updates parameters of the window to the appropriate values on load
internal void UpdateInitialParameters(Document doc)
{
Transaction t = new Transaction(doc, "Update parameters");
t.Start();
SchemaBuilder builder = new SchemaBuilder(m_schemaId); //(new Guid("{4DE4BE80-0857-4785-A7DF-8A8918851CB2}"));
builder.AddSimpleField("Position", typeof(XYZ)).SetUnitType(UnitType.UT_Length);
builder.AddSimpleField("Orientation", typeof(XYZ)).SetUnitType(UnitType.UT_Length);
builder.SetSchemaName("WallPositionData");
builder.SetDocumentation("Two points in a Window element that assist in placing a section view.");
builder.SetVendorId("adsk");
builder.SetApplicationGUID(doc.Application.ActiveAddInId.GetGUID());
m_schema = builder.Finish();
t.Commit();
t.Start();
Field fieldPosition = m_schema.GetField("Position");
Field fieldOrientation = m_schema.GetField("Orientation");
FamilyInstance window = doc.get_Element(m_windowId) as FamilyInstance;
Entity storageEntity = new Entity(m_schema);
LocationPoint lp = window.Location as LocationPoint;
XYZ location = lp.Point;
storageEntity.Set<XYZ>(fieldPosition, location, DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES);
XYZ orientation = window.FacingOrientation;
storageEntity.Set<XYZ>(fieldOrientation, orientation, DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES);
window.SetEntity(storageEntity);
t.Commit();
}