Class DocumentAPI
Last update: 16.07.2025Namespace: VM.API.Pre
Assembly: VM.API.Pre.dll
This class implements APIs for document.
public static class DocumentAPI
Inheritance
Extension Methods
LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType), LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType), LinkPropertyItemCache.GetLinkedObjects<T>(object, LinkPropertyType)
Methods
CloseDocument(IDocument)
Close
[NotNull(new string[] { "document" })]
public static void CloseDocument(this IDocument document)
Parameters
document IDocument
The document to be saved.
Exceptions
Will be thrown if 'document' argument is null.
CreateNewPartDocument(string, string, Unit, double, LengthUnitType)
Create
public static PartDocument CreateNewPartDocument(string newPartFilePath, string documentName = "Part", Unit unit = null, double iconSize = 1, LengthUnitType kernelLengthUnit = LengthUnitType.MM)
Parameters
newPartFilePath string
The file path of new part.
documentName string
The name of document.
unit Unit
The unit information.
iconSize double
The size of icon.
kernelLengthUnit LengthUnitType
The length unit of kernel.
Returns
PartDocument
The new
CreateNewSubsystemDocument(string, string, Vector, Unit, double, bool, Plane, bool, LengthUnitType)
Create
public static SubSystemDocument CreateNewSubsystemDocument(string newSubsystemFilePath, string documentName = "Subsystem", Vector gravity = default, Unit unit = null, double iconSize = 1, bool advancedMode = true, Plane symmetricPlane = Plane.YZ, bool useSymmetric = false, LengthUnitType kernelLengthUnit = LengthUnitType.MM)
Parameters
newSubsystemFilePath string
The file path of new subsystem.
documentName string
The name of document.
gravity Vector
The gravity value.
unit Unit
The unit information.
iconSize double
The size of icon.
advancedMode bool
The flag whether using advanced mode.
symmetricPlane Plane
The symetric plane.
useSymmetric bool
The flag whether using symmetric.
kernelLengthUnit LengthUnitType
The length unit of kernel.
Returns
SubSystemDocument
The new
CreateNewSubsystemFromTemplateDocument(string, string)
Create
public static SubSystemDocument CreateNewSubsystemFromTemplateDocument(string newSubsystemFromTemplateFilePath, string existedSubsystemTemplateFilePath)
Parameters
newSubsystemFromTemplateFilePath string
The file path of new subsystem from template file path.
existedSubsystemTemplateFilePath string
The file path of existed subsystem template file path.
Returns
SubSystemDocument
The new
CreateNewTemplateDocument(string, string, Vector, Unit, double, bool, Plane, bool, LengthUnitType)
Create
[NotNullOrEmpty(new string[] { "newSubsystemTemplateFilePath" })]
public static SubSystemDocument CreateNewTemplateDocument(string newSubsystemTemplateFilePath, string documentName = "Subsystem_Template", Vector gravity = default, Unit unit = null, double iconSize = 1, bool advancedMode = true, Plane symmetricPlane = Plane.YZ, bool useSymmetric = false, LengthUnitType kernelLengthUnit = LengthUnitType.MM)
Parameters
newSubsystemTemplateFilePath string
The file path of new subsystem template.
documentName string
The name of document.
gravity Vector
The gravity value.
unit Unit
The unit information.
iconSize double
The size of icon.
advancedMode bool
The flag whether using advanced mode.
symmetricPlane Plane
The symetric plane.
useSymmetric bool
The flag whether using symmetric.
kernelLengthUnit LengthUnitType
The length unit of kernel.
Returns
SubSystemDocument
The new
ModifyScenario(IDocument, Obj, bool)
Modify
[NotNull(new string[] { "document" })]
[MatchTypeObj(new object[] { "scenario", typeof(Scenario) })]
public static void ModifyScenario(this IDocument document, Obj scenario, bool use = false)
Parameters
document IDocument
The document to modify the simulation scenario.
scenario Obj
The simulation scenario.
use bool
The use flag to modify the simulation scenario.
Exceptions
Will be thrown if 'document' argument is null.
Will be thrown if the type of 'scenario' is not Scenario.
SaveDocument(IDocument)
Save
[NotNull(new string[] { "document" })]
public static void SaveDocument(this IDocument document)
Parameters
document IDocument
The document to be saved.
Exceptions
Will be thrown if 'document' argument is null.
SaveDocument(IDocument, string)
Save
[NotNull(new string[] { "document" })]
[NotNullOrEmpty(new string[] { "filePath" })]
public static void SaveDocument(this IDocument document, string filePath)
Parameters
document IDocument
The document to be saved.
filePath string
The document file path to be saved
Exceptions
Will be thrown if 'document' or 'filePath' arguments are null.