|
| | SdkApi (ICadDocument document, IScriptDocument recipe, int actionId) |
| | Initialize a new api object.
|
| void | Dispose () |
| SdkAnnotationInfo | AddAnnotation (ISdkAnnotation annotation, ISdkVertex3D location, ISdkVector3D orientation, ISdkVector3D planeNormal, float scale, float layerDepthFactor=0.0001f) |
| | Add an annotation.- Parameters
-
| 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 |
- Returns
- Information about the newly created 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.- Parameters
-
| 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
|
| ISdkView[] | GetViews () |
| | Get all views.- Returns
- An array of view objects.
|
| 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.- Parameters
-
- Returns
- Returns the update count or -1 if the view does not exist.
|
| 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.- Parameters
-
| view | The fully specified view definition. |
|
| object | GetWorkspaceAttribute (string attributeName) |
| | Get a workspace attribute value.- Parameters
-
| attributeName | The name of the attribute. |
- Returns
- The attribute value.
|
| void | SetWorkspaceAttribute (string attributeName, object attributeValue) |
| | Add or overwrite a workspace attribute value.- Parameters
-
| attributeName | The name of the attribute (will be published, used in the UI, etc.). |
| attributeValue | The value of the attribute. |
|
| 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.- Parameters
-
| 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. |
- Returns
- An array of entities. The array will be empty if nothing is found.
|
| 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.- Parameters
-
| sourceHandles | The source entity handles. |
| targetEntityType | The desired type of entity handle to return. |
- Returns
- Distinct set of entity handles. Returns an empty array when the conversion is not possible (cannot convert PMI occurrence to component for example).
|
| object | GetEntityAttribute (ISdkEntityHandle entityHandle, string attributeName) |
| | Get an attribute value from an entity.- Parameters
-
| entityHandle | The entity containing the attribute to retrieve |
| attributeName | The name of the attribute to retrieve |
- Returns
- The attribute value
|
| void | SetEntityAttribute (ISdkEntityHandle entityHandle, string attributeName, object attributeValue) |
| | Set an entity attribute value. Creates a new attribute if the attribute does not already exist.- Parameters
-
| entityHandle | The entity to modify |
| attributeName | The name of the attribute to set |
| attributeValue | The value of the attribute |
|
| string[] | GetAttributeNames (SdkEntityType entityType) |
| | Get the available attribute names for a specified entity type.- Parameters
-
| entityType | The entity type |
- Returns
- Array of attribute names.
|
| 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.- Parameters
-
| entityHandle | The handle to the part or annotation. |
- Returns
- A 3D bounding box
|
| 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.- Parameters
-
| entityHandle | The handle to a part. |
- Returns
- An array of 3D vertices.
|
| Dictionary< ISdkEntityHandle, float > | FindObjectsByLocation (IEnumerable< ISdkEntityHandle > visibleEntities, ISdkVertex3D objectLocationInWorldCoords, 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.- Parameters
-
| 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. |
- Returns
- A Dictionary of part or occurrence handles and associated observed closest intersection distances from objectLocation. The Dictionary will be empty if nothing is found.
|
| ISdkMatrix4X4 | GetTransform (ISdkEntityHandle entityHandle) |
| | Gets the current 3D transform for a part or assembly instance.- Parameters
-
| entityHandle | A part instance or an assembly instance. |
- Returns
- The 3D transformation matrix.
|
| void | SetTransform (ISdkEntityHandle entityHandle, ISdkMatrix4X4 transformMatrix) |
| | Updates the 3D transform on a part or assembly instance.- Parameters
-
| entityHandle | A part instance or an assembly instance. |
| transformMatrix | The 3D transform to apply. |
|
| 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.
|
| 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.- Parameters
-
| view | The view to modify. |
| handles | The occurrence handles of the 3D entities to show in the view. |
|