本文整理汇总了C#中ElementId类的典型用法代码示例。如果您正苦于以下问题:C# ElementId类的具体用法?C# ElementId怎么用?C# ElementId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementId类属于命名空间,在下文中一共展示了ElementId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnElementBegin
public RenderNodeAction OnElementBegin(ElementId inID)
{
m_stackElementId.Push(inID);
// Category category = CurrentElement.get_Category();
//category.CategoryType == CategoryType.
//bool _b = category != null && (category.get_Id().get_IntegerValue().Equals(-2001320) || category.get_Id().get_IntegerValue().Equals(-2000175) || category.get_Id().get_IntegerValue().Equals(-2000126));
// if ()
// {
//this.ExportSolids(element);
// return RenderNodeAction.Skip;
// }
// if (this.IsElementDecal(element))
//{
// //this.ExportDecal(element);
// return RenderNodeAction.Skip;
// }
// if (CurrentElement.Category == )
// {
String _name = CurrentElement.Category.Name + "_0_" + CurrentElement.Name;
m_Exporter.BeginMesh(_name);
return RenderNodeAction.Proceed;
// }
// else
// return RenderNodeAction.Skip;
}
示例2: Register
/// <summary>
/// Register the exported part and its host and level.
/// </summary>
/// <param name="partId">The exported part.</param>
/// <param name="hostOverideLevels">The dictionary of host and level the part has exported.</param>
public void Register(ElementId partId, Dictionary<ElementId, ElementId> hostOverideLevels)
{
if (HasRegistered(partId))
return;
m_PartExportedDictionary[partId] = hostOverideLevels;
}
示例3: Register
/// <summary>
/// Adds the IfcMaterialLayerSet handle to the dictionary.
/// </summary>
/// <param name="elementId">
/// The element elementId.
/// </param>
/// <param name="handle">
/// The IfcMaterialLayerSet handle.
/// </param>
public void Register(ElementId elementId, IFCAnyHandle handle)
{
if (m_ElementIdToMatLayerSetDictionary.ContainsKey(elementId))
return;
m_ElementIdToMatLayerSetDictionary[elementId] = handle;
}
示例4: Register
/// <summary>
/// Adds the handle to the dictionary.
/// </summary>
/// <param name="elementId">
/// The element elementId.
/// </param>
/// <param name="handle">
/// The handle.
/// </param>
public void Register(ElementId elementId, IFCAnyHandle handle)
{
if (elementIdToHandleDictionary.ContainsKey(elementId))
return;
elementIdToHandleDictionary[elementId] = handle;
}
示例5: Register
/// <summary>
/// Adds the IfcPresentationStyleAssignment handle to the dictionary.
/// </summary>
/// <param name="elementId">
/// The element elementId.
/// </param>
/// <param name="handle">
/// The IfcPresentationStyleAssignment handle.
/// </param>
public void Register(ElementId elementId, IFCAnyHandle handle)
{
if (m_Styles.ContainsKey(elementId.IntegerValue))
throw new Exception("TextStyleCache already contains handle for elementId " + elementId.IntegerValue);
m_Styles[elementId.IntegerValue] = handle;
}
示例6: Register
/// <summary>
/// Register the host element and its levels and ranges.
/// </summary>
/// <param name="hostId">The ElementId of host element.</param>
/// <param name="levelRanges">The list of level and IFCRange pair.</param>
public void Register(ElementId hostId, List<KeyValuePair<ElementId, IFCRange>> levelRanges)
{
if (HasRegistered(hostId))
return;
m_DummyHostDictionary[hostId] = levelRanges;
}
示例7: CanExportElementInPartExport
/// <summary>
/// Identifies if the host element can export when exporting parts.
/// 1. If host element has non merged parts (>0), it can be export no matter if it has merged parts or not, and return true.
/// 2. If host element has merged parts
/// - If the merged part is the right category and not export yet, return true.
/// - If the merged part is the right category but has been exported by other host, return false.
/// - If the merged part is not the right category, should not export and return false.
/// </summary>
/// <param name="hostElement">The host element having parts.</param>
/// <param name="levelId">The level the part would export.</param>
/// <Param name="IsSplit">The bool flag identifies if the host element is split by story.</Param>
/// <returns>True if the element can export, false otherwise.</returns>
public static bool CanExportElementInPartExport(Element hostElement, ElementId levelId, bool IsSplit)
{
List<ElementId> associatedPartsList = PartUtils.GetAssociatedParts(hostElement.Document, hostElement.Id, false, true).ToList();
foreach (ElementId partId in associatedPartsList)
{
Part part = hostElement.Document.GetElement(partId) as Part;
if (PartUtils.IsMergedPart(part))
{
if (part.OriginalCategoryId == hostElement.Category.Id)
{
if (IsSplit)
{
if (!ExporterCacheManager.PartExportedCache.HasExported(partId, levelId))
{
// has merged split part and not export yet.
return true;
}
}
else if (!ExporterCacheManager.PartExportedCache.HasRegistered(partId))
{
// has merged part and not export yet.
return true;
}
}
}
else
{
return true;
}
}
// has no merged parts or other parts or merged parts have been exported.
return false;
}
示例8: Register
/// <summary>
/// Adds the list of parts to the dictionary.
/// </summary>
/// <param name="hostId">
/// The host element elementId.
/// </param>
/// <param name="partsList">
/// The list of parts.
/// </param>
public void Register(ElementId hostId, Dictionary<ElementId, List<KeyValuePair<Part, IFCRange>>> levelParts)
{
if (HasRegistered(hostId))
return;
m_HostToPartsDictionary[hostId] = levelParts;
}
示例9: SpatialFieldUpdater
public SpatialFieldUpdater(AddInId id, ElementId sphere, ElementId view)
{
addinID = id;
sphereID = sphere;
viewID = view;
updaterID = new UpdaterId(addinID, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
}
示例10: OnStartup
public Result OnStartup(UIControlledApplication a)
{
//Create Ribbon Panel add the UI button on start up
RibbonPanel alignViewsPanel = ribbonPanel(a);
//Register location updater with Revit.
LocationUpdater updater = new LocationUpdater(a.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(updater, true);
ElementCategoryFilter viewPortFilter = new ElementCategoryFilter(BuiltInCategory.OST_Viewports);
ElementCategoryFilter viewFilter = new ElementCategoryFilter(BuiltInCategory.OST_Views);
LogicalOrFilter filter = new LogicalOrFilter(viewPortFilter, viewFilter);
//Parameter to send to the trigger.
ElementClassFilter viewPort = new ElementClassFilter(typeof(Viewport));
ElementId viewPortNumberId = new ElementId(BuiltInParameter.VIEWPORT_DETAIL_NUMBER);
//Set trigger
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), viewPort, Element.GetChangeTypeParameter(viewPortNumberId));
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeElementAddition());
//add buttons to ribbon
addVRCommandButtons(alignViewsPanel);
pushButton_Setting(alignViewsPanel);
return Result.Succeeded;
}
示例11: GetBoundaryCorners
List<XYZ> GetBoundaryCorners( FilledRegion region )
{
List<XYZ> result = new List<XYZ>();
ElementId id = new ElementId(
region.Id.IntegerValue - 1 );
Sketch sketch = region.Document.GetElement(
id ) as Sketch;
if( null != sketch )
{
CurveArray curves = sketch.Profile.get_Item( 0 );
if( null != curves )
{
foreach( Curve cur in curves )
{
XYZ corner = cur.GetEndPoint( 0 );
result.Add( corner );
}
}
}
return result;
}
示例12: ViewPortInfo
public ViewPortInfo(ElementId id, XYZ location, View v, Viewport vp)
{
this.id = id;
this.location = location;
this.view = v;
this.vport = vp;
}
示例13: Validate
/// <summary>
/// True if the ElementId represents a valid phase.
/// </summary>
/// <returns>True if it is valid, false otherwise.</returns>
static public bool Validate(ElementId phaseId)
{
if (phaseId == ElementId.InvalidElementId)
return false;
Element checkPhase = IFCCommandOverrideApplication.TheDocument.GetElement(phaseId);
return (checkPhase != null && (checkPhase is Phase));
}
示例14: SheetModelCollections
public SheetModelCollections( ElementId projectInfoId )
{
ProjectInfoId = projectInfoId;
SheetIds = new List<ElementId>();
ViewsInSheet = new Dictionary<ElementId, List<ViewData>>();
Symbols = new Dictionary<ElementId, GeomData>();
BimelsInViews = new Dictionary<ElementId, List<ObjData>>();
}
示例15: IFCMaterialInfo
protected IFCMaterialInfo(Color color, int? transparency, int? shininess, int? smoothness, ElementId id)
{
Color = color;
Transparency = transparency;
Shininess = shininess;
Smoothness = smoothness;
ElementId = id;
}