|
Anark Core SDK
|
The SDK API. More...
Public Member Functions | |
| SdkAnnotationInfo | AddAnnotation (ISdkAnnotation annotation, ISdkVertex3D location, ISdkVector3D orientation, ISdkVector3D planeNormal, float scale, float layerDepthFactor=0.0001f) |
| Add an annotation. | |
| void | RemoveMyAnnotations (ISdkEntityHandle[] annotationHandles) |
| Removes annotations that have been created by your plug-in. This will not remove annotations from the imported 3D data and this will not remove annotations created by other plug-ins. This will remove the annotations from all user-defined views. | |
| void | AddVisibleOccurrencesToView (ISdkView view, IEnumerable< ISdkEntityHandle > handles) |
| Show specified 3D entities in a view that has been authored in Anark Core Workstation. This replaces any prior set of 3D entities for the specified view that were previously made visible in a call to AddVisibleOccurrencesToView with the current set of 3D entity handles (i.e. this method cannot be used to incrementally add an additional visibility state). Visibility states that were specified by Anark Core Workstation users will be retained (not overwritten). The modifications will be retained in the Anark Core Recipe. Limitations: the view cannot be an imported view, and the entities to make visible must be entities that have been created via this SDK API. | |
| ISdkView[] | GetViews () |
| Get all views. | |
| int | GetViewUpdateCount (ISdkView view) |
| Gets the view update count, which is a counter that is incremented whenever there is any update to a view. It can be used for an incremental update mechanism where you only update views that have changed, by comparing this number against the value at your last plug-in execution. | |
| void | AddUserEditableView (ISdkView view) |
| Adds a new view to the list of user-authored views. Will throw an exception if you target entities under collapsed assemblies or add a view with a duplicate name. | |
| string[] | GetAttributeNames (SdkEntityType entityType) |
| Get the available attribute names for a specified entity type. | |
| ISdkEntityHandle[] | Search (ISdkQueryExpression query, SdkEntityType resultEntityType=SdkEntityType.Invalid) |
| Search for entities with a query expression. This returns the same results as the Query functionality in Anark Core Workstation. | |
| object | GetEntityAttribute (ISdkEntityHandle entityHandle, string attributeName) |
| Get an attribute value from an entity. | |
| void | SetEntityAttribute (ISdkEntityHandle entityHandle, string attributeName, object attributeValue) |
| Set an entity attribute value. Creates a new attribute if the attribute does not already exist. | |
| object | GetWorkspaceAttribute (string attributeName) |
| Get a workspace attribute value. | |
| void | SetWorkspaceAttribute (string attributeName, object attributeValue) |
| Add or overwrite a workspace attribute value. | |
| void | RemoveMyAttributes () |
| Removes all attributes that were created by the caller. Includes workspace attributes and attributes in other entities. Does not revert any attribute values that have been set for attributes that were not created by the caller. | |
| ISdk3DBoundingBox | GetBoundingBox (ISdkEntityHandle entityHandle) |
| Gets the 3D bounding box of a part or annotation, in the local coordinate system of the part or annotation. | |
| ISdkVertex3D[] | GetPartVertices (ISdkEntityHandle entityHandle) |
| Gets the 3D mesh points for a part. Note that this can be a relatively expensive operation - see GetBoundingBox if you only need the part bounding box. The points are returned in the part's local coordinate system. | |
| Dictionary< ISdkEntityHandle, float > | FindObjectsByLocation (IEnumerable< ISdkEntityHandle > visibleEntities, ISdkVertex3D objectLocation, float maxDistance=float.MaxValue, SdkEntityType resultEntityType=SdkEntityType.Component) |
| Provides a point-to-solid interference clash test to identify parts or part occurrences in which a specific point is located. Identifies all objects that are nearer than maxDistance from objectLocation and their associated observed distances. | |
| ISdkMatrix4X4 | GetTransform (ISdkEntityHandle entityHandle) |
| Gets the current 3D transform for a part or assembly instance. | |
| void | SetTransform (ISdkEntityHandle entityHandle, ISdkMatrix4X4 transformMatrix) |
| Updates the 3D transform on a part or assembly instance. | |
| ISdk3DGeometry | GetGeometry (ISdkEntityHandle entityHandle) |
| Gets the geometric representation of a Supplemental Geometry Definition or Occurrence Given a Supplemental Definition Entity, Local coordinates will be returned. Given a Supplemental Geometry Occurrence, Global coordinates for that particular occurrence will be returned. | |
| ISdkEntityHandle[] | ConvertEntityHandles (ISdkEntityHandle[] sourceHandles, SdkEntityType targetEntityType) |
| Follows the object references to "convert" entity handles to the desired target entity type. For example, you can convert a component occurrence handle to a component instance and/or a component. The reverse is not true because it is often ambiguous. This can be useful if you have search results for component instances and you need to reference the actual component (part/assembly) for one or more of those instances. Also applies to PMI, etc. | |
The SDK API.
| SdkAnnotationInfo Anark.CoreSdkApi.ISdkApi.AddAnnotation | ( | ISdkAnnotation | annotation, |
| ISdkVertex3D | location, | ||
| ISdkVector3D | orientation, | ||
| ISdkVector3D | planeNormal, | ||
| float | scale, | ||
| float | layerDepthFactor = 0.0001f ) |
Add an annotation.
| annotation | The annotation to add - the origin of the 2D coordinate system of the annotation will be placed relative to the specified location. |
| location | The annotation's location in 3D space. |
| orientation | The orientation vector of the annotation - this is relative to the specified location. |
| planeNormal | The normal of the plane in which the annotation exists. |
| scale | The scale to apply to the annotation geometry. 1.0f is 100% (no change), 2.0f will scale the annotation twice as large, etc. |
| layerDepthFactor | The difference in depth between layers of geometry, as a proportion of the geometry's total height. 0.0001 by default |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.AddUserEditableView | ( | ISdkView | view | ) |
Adds a new view to the list of user-authored views. Will throw an exception if you target entities under collapsed assemblies or add a view with a duplicate name.
| view | The fully specified view definition. |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.AddVisibleOccurrencesToView | ( | ISdkView | view, |
| IEnumerable< ISdkEntityHandle > | handles ) |
Show specified 3D entities in a view that has been authored in Anark Core Workstation. This replaces any prior set of 3D entities for the specified view that were previously made visible in a call to AddVisibleOccurrencesToView with the current set of 3D entity handles (i.e. this method cannot be used to incrementally add an additional visibility state). Visibility states that were specified by Anark Core Workstation users will be retained (not overwritten). The modifications will be retained in the Anark Core Recipe. Limitations: the view cannot be an imported view, and the entities to make visible must be entities that have been created via this SDK API.
| view | The view to modify. |
| handles | The occurrence handles of the 3D entities to show in the view. |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdkEntityHandle[] Anark.CoreSdkApi.ISdkApi.ConvertEntityHandles | ( | ISdkEntityHandle[] | sourceHandles, |
| SdkEntityType | targetEntityType ) |
Follows the object references to "convert" entity handles to the desired target entity type. For example, you can convert a component occurrence handle to a component instance and/or a component. The reverse is not true because it is often ambiguous. This can be useful if you have search results for component instances and you need to reference the actual component (part/assembly) for one or more of those instances. Also applies to PMI, etc.
| sourceHandles | The source entity handles. |
| targetEntityType | The desired type of entity handle to return. |
Implemented in Anark.CoreSdkApi.SdkApi.
| Dictionary< ISdkEntityHandle, float > Anark.CoreSdkApi.ISdkApi.FindObjectsByLocation | ( | IEnumerable< ISdkEntityHandle > | visibleEntities, |
| ISdkVertex3D | objectLocation, | ||
| float | maxDistance = float.MaxValue, | ||
| SdkEntityType | resultEntityType = SdkEntityType.Component ) |
Provides a point-to-solid interference clash test to identify parts or part occurrences in which a specific point is located. Identifies all objects that are nearer than maxDistance from objectLocation and their associated observed distances.
| visibleEntities | Entities to be considered "visible" - i.e. those entities which should take part in the interference clash test. |
| objectLocation | The start point of all rays used to intersect parts in the model. |
| maxDistance | The maximum distance to consider when finding close objects. |
| resultEntityType | The resulting entity type to return. Valid types are SdkEntityType.Component (returns matching part definitions) and SdkEntityType.ComponentOccurrence (returns matching part occurrences). Omit this parameter to return part definitions. |
Implemented in Anark.CoreSdkApi.SdkApi.
| string[] Anark.CoreSdkApi.ISdkApi.GetAttributeNames | ( | SdkEntityType | entityType | ) |
Get the available attribute names for a specified entity type.
| entityType | The entity type |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdk3DBoundingBox Anark.CoreSdkApi.ISdkApi.GetBoundingBox | ( | ISdkEntityHandle | entityHandle | ) |
Gets the 3D bounding box of a part or annotation, in the local coordinate system of the part or annotation.
| entityHandle | The handle to the part or annotation. |
Implemented in Anark.CoreSdkApi.SdkApi.
| object Anark.CoreSdkApi.ISdkApi.GetEntityAttribute | ( | ISdkEntityHandle | entityHandle, |
| string | attributeName ) |
Get an attribute value from an entity.
| entityHandle | The entity containing the attribute to retrieve |
| attributeName | The name of the attribute to retrieve |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdk3DGeometry Anark.CoreSdkApi.ISdkApi.GetGeometry | ( | ISdkEntityHandle | entityHandle | ) |
Gets the geometric representation of a Supplemental Geometry Definition or Occurrence Given a Supplemental Definition Entity, Local coordinates will be returned. Given a Supplemental Geometry Occurrence, Global coordinates for that particular occurrence will be returned.
| entityHandle | The Supplemental Geometry Definition or Occurrence |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdkVertex3D[] Anark.CoreSdkApi.ISdkApi.GetPartVertices | ( | ISdkEntityHandle | entityHandle | ) |
Gets the 3D mesh points for a part. Note that this can be a relatively expensive operation - see GetBoundingBox if you only need the part bounding box. The points are returned in the part's local coordinate system.
| entityHandle | The handle to a part. |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdkMatrix4X4 Anark.CoreSdkApi.ISdkApi.GetTransform | ( | ISdkEntityHandle | entityHandle | ) |
Gets the current 3D transform for a part or assembly instance.
| entityHandle | A part instance or an assembly instance. |
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdkView[] Anark.CoreSdkApi.ISdkApi.GetViews | ( | ) |
| int Anark.CoreSdkApi.ISdkApi.GetViewUpdateCount | ( | ISdkView | view | ) |
Gets the view update count, which is a counter that is incremented whenever there is any update to a view. It can be used for an incremental update mechanism where you only update views that have changed, by comparing this number against the value at your last plug-in execution.
| view | The view. |
Implemented in Anark.CoreSdkApi.SdkApi.
| object Anark.CoreSdkApi.ISdkApi.GetWorkspaceAttribute | ( | string | attributeName | ) |
Get a workspace attribute value.
| attributeName | The name of the attribute. |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.RemoveMyAnnotations | ( | ISdkEntityHandle[] | annotationHandles | ) |
Removes annotations that have been created by your plug-in. This will not remove annotations from the imported 3D data and this will not remove annotations created by other plug-ins. This will remove the annotations from all user-defined views.
| annotationHandles | An array of annotation handles. The handles must be handles to the annotation definition rather than the annotation occurrence. This would typically be the results of a query searching for SdkEntityType.Pmi. |
SdkAnnotationInfo.DefinitionHandle SdkEntityType.Pmi
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.RemoveMyAttributes | ( | ) |
Removes all attributes that were created by the caller. Includes workspace attributes and attributes in other entities. Does not revert any attribute values that have been set for attributes that were not created by the caller.
Implemented in Anark.CoreSdkApi.SdkApi.
| ISdkEntityHandle[] Anark.CoreSdkApi.ISdkApi.Search | ( | ISdkQueryExpression | query, |
| SdkEntityType | resultEntityType = SdkEntityType.Invalid ) |
Search for entities with a query expression. This returns the same results as the Query functionality in Anark Core Workstation.
| query | The query expression. |
| resultEntityType | The resulting entity type to return. Omit this argument to directly return the entities from the query. Pass a different entity type to perform a conversion, where applicable. For example, when searching for CAD entities, the default entity return type will be occurrences, but this could be converted to a distinct collection of components. |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.SetEntityAttribute | ( | ISdkEntityHandle | entityHandle, |
| string | attributeName, | ||
| object | attributeValue ) |
Set an entity attribute value. Creates a new attribute if the attribute does not already exist.
| entityHandle | The entity to modify |
| attributeName | The name of the attribute to set |
| attributeValue | The value of the attribute |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.SetTransform | ( | ISdkEntityHandle | entityHandle, |
| ISdkMatrix4X4 | transformMatrix ) |
Updates the 3D transform on a part or assembly instance.
| entityHandle | A part instance or an assembly instance. |
| transformMatrix | The 3D transform to apply. |
Implemented in Anark.CoreSdkApi.SdkApi.
| void Anark.CoreSdkApi.ISdkApi.SetWorkspaceAttribute | ( | string | attributeName, |
| object | attributeValue ) |
Add or overwrite a workspace attribute value.
| attributeName | The name of the attribute (will be published, used in the UI, etc.). |
| attributeValue | The value of the attribute. |
Implemented in Anark.CoreSdkApi.SdkApi.