new ANARKCOREDATA(buildOccurrenceStructure, enableProcessPlanning)
The main Anark JavaScript API object providing various data and functionality. Copyright 2007-2019 Anark Corporation. All rights reserved..
Parameters:
| Name | Type | Description |
|---|---|---|
| buildOccurrenceStructure | bool | Optional. If true, this will provide an occurrence tree structure to use (adds parent/child object references to the occurrences). |
| enableProcessPlanning | bool | Optional. If true, this will create additional objects to assist with process planning data access, specifically the processPlanning property (see ProcessPlanning). |
Members
-
inner FontStyleEnum
-
Available font styles. These font styles can be combined using bitwise operators, example: (NORMAL | BOLD).
Properties:
Name Type Description NORMAL number Normal BOLD number ITALIC number UNDERLINE number
Methods
-
createColorFromFloat(r, g, b) → {object}
-
Creates an object that represents a color using floating point notation.
Parameters:
Name Type Description r float The red value. g float The green value. b float The blue value. Returns:
object An object that represents the specified color in the form of: { rgb: [r, g, b], hex: "#xrxgxb" }. -
createColorFromHexNotation(hex) → {object}
-
Creates an object that represents a color using html/web notation.
Parameters:
Name Type Description hex string The html/web color strictly in the form: '#001122' Returns:
object An object that represents the specified color in the form of: { rgb: [r, g, b], hex: "#xrxgxb" }. -
fontStyles() → {ANARKCOREDATA~FontStyleEnum}
-
Get available font styles.
Returns:
ANARKCOREDATA~FontStyleEnum The available font styles. -
getAttributesAsHash(entity) → {Array}
-
Get the attributes as a hash table where the attribute name is the hash key. This offers the best performance when doing random attribute lookups.
Parameters:
Name Type Description entity Entity The entity that contains the desired attributes. Returns:
Array Returns a hash of attributeName, attributeValue pairs. -
getAttributesInOriginalOrder(entity) → {Array}
-
Get the attributes in their original order without sorting.
Parameters:
Name Type Description entity Entity The entity that contains the desired attributes. Returns:
Array Returns an array of objects in the form of: { name: attributeName, objectValue: attributeValue } -
getAttributesInSmartSortedOrder(entity) → {Array}
-
Get the attributes in a sorted array. The attributes are sorted alphabetically by name but if 2 or more attribute names are the same and end in a number, the numbers are sorted numerically rather than alphabetically.
Parameters:
Name Type Description entity Entity The entity that contains the desired attributes. Returns:
Array Returns a sorted array of objects in the form of: { name: attributeName, objectValue: attributeValue } -
getComponents() → {Array.<Component>}
-
Get all CAD components.
Returns:
Array.<Component> An array of components. -
getEntityById(cadEntityId) → {Entity}
-
Get an entity by its unique id.
Parameters:
Name Type Description cadEntityId integer The unique id of the entity. Returns:
Entity The matching entity or undefined if the id was not found. -
getFileAttachments()
-
Gets all file attachments. Returns an empty array if there are no attachments.
Returns:
Array of file names. -
getGdtAnnotations() → {Array.<Entity>}
-
Get all CAD GD&T annotations.
Returns:
Array.<Entity> An array of GD&T annotations. -
getInstances() → {Array.<Entity>}
-
Get all CAD instances.
Returns:
Array.<Entity> An array of instances. -
getOccurrences() → {Array.<Occurrence>}
-
Get all CAD occurrences.
- See:
- The ANARKCOREDATA constructor to create a structured occurrence tree.
Returns:
Array.<Occurrence> A flat array of occurrences. -
getPublishingSettings()
-
Get the settings that were used to publish the content.
Returns:
The settings object, containing property/value pairs. -
getRootOccurrence() → {Occurrence}
-
Gets the root CAD occurrence.
Returns:
Occurrence The root occurrence. -
getSupplementals() → {Array.<Entity>}
-
Get all CAD supplemental geometry.
Returns:
Array.<Entity> An array of supplemental geometry entities. -
getViews() → {Array.<Entity>}
-
Get all CAD views. If view sorting has been enabled, this will return the views in order according to the view name. If view sorting is disabled, this returns the views in their original order.
Returns:
Array.<Entity> An array of views. -
getVisibleItemsByViewOccurrenceId(viewOccurrenceId) → {Array.<Entity>}
-
Get all visible items for a given view occurrence id.
Parameters:
Name Type Description viewOccurrenceId integer The cadEntityId of the view occurrence. Returns:
Array.<Entity> An array of entities that are visible in the specified view. -
getWorkspaceAttribute(attributeName) → {object}
-
Get a workspace attribute by name.
Parameters:
Name Type Description attributeName string The name of the workspace attribute. Returns:
object Returns the attribute value. -
getWorkspaceAttributes() → {Array}
-
Get all workspace attributes.
Returns:
Array Returns a hash of attributeName, attributeValue pairs. -
getWorkspaceTableByName(tableName) → {Table}
-
Gets a table from the workspace attributes. Creates a new table each time.
Parameters:
Name Type Description tableName string The name of the workspace table attribute. Returns:
Table A new table object representing the specified table attribute. -
resolveVisibleItems()
-
Resolves view VisibleIds into entities.
-
sortViewsByName(enableSortingByName)
-
Enable/disable view sorting.
Parameters:
Name Type Description enableSortingByName boolean True to enable alphabetic view sorting, false to disable view sorting.