GetSurfaceArea Activity

Purpose: This activity gets the surface area of a SolidWorks part document. The surface area is calculated based on the part geometry and is returned as a string with units. This is useful for manufacturing cost estimation, coating calculations, or material usage analysis.

Input Properties

DocumentId

ID of an open SolidWorks document. This should be the document ID returned by activities like OpenSolidWorksFile or GetActiveDoc.

Type: string

Required: Yes

Example: "doc-12345"

Output Properties

SurfaceArea

The surface area of the part as a string with units. The format includes the numeric value and unit designation (e.g., "1250.5 mm^2" or "1.25 m^2").

Type: string

Note: If an error occurs, this will contain an error message starting with "Error: " or "Unexpected error: ".

Example: "1250.5 mm^2" or "1.25 m^2" or "19.4 in^2"

Usage Example

Scenario: Get the surface area of a part for coating calculation

Configuration:
- DocumentId: "doc-12345"

Result:
- SurfaceArea: "1250.5 mm^2" (or error message if failed)

Next Steps:
Use the SurfaceArea value to calculate coating requirements, material usage, or manufacturing costs.

Error Handling

Important: The activity handles errors gracefully:

  • If the document ID is invalid or the document cannot be found, an InvalidOperationException will be caught and SurfaceArea will contain: "Error: {error message}"
  • If the surface area cannot be calculated (e.g., part is not fully defined), SurfaceArea will contain an error message
  • Any other unexpected errors will be caught and SurfaceArea will contain: "Unexpected error: {error message}"

Always check the SurfaceArea output to ensure it doesn't start with "Error:" before using it in calculations.

Important Notes

  • The document must be a SolidWorks part document (not an assembly or drawing)
  • The document must be open in SolidWorks and accessible via the DocumentId
  • The part must be fully defined for accurate surface area calculation
  • Surface area units depend on the document's unit system (MMGS, IPS, etc.)
  • The calculation includes all surfaces of the part, including internal surfaces if the part has cavities
  • Surface area is useful for coating calculations, heat transfer analysis, and material usage estimation
  • Use this activity in combination with GetVolume for comprehensive geometric analysis

Related Activities