pCon.planner Plugin SDK  Version 8.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Properties | Events | List of all members
X3g::Plugin::DocumentManager Class Reference

Document Manager. More...

Public Member Functions

IList< DbEntity^ >^ GetSelection ()
 Retrieves all currently selected entities. More...
 
void SetSelection (IEnumerable< DbEntity^ >^pSelection)
 Sets selected entities. More...
 
bool NewPlanning ()
 Clears the document to start a new planning. More...
 
bool LoadPlanning (String^ pFileName)
 Loads a planning. More...
 
bool SavePlanning (String^ pFileName, DocumentFileFormat pVersion, bool pCopy)
 Saves the current planning. More...
 
bool SaveEntities (String^ pFileName, IEnumerable< DbEntity^ >^pEntities, DocumentFileType pType, DocumentFileFormat pVersion)
 Saves given entities as dwg/dxf. More...
 
IList< DbEntity^ >^ InsertPlanning (String^ pFileName, bool pInteractive)
 Inserts a planning into the current planning. More...
 
IList< DbEntity^ >^ InsertPlanning (System::IO::Stream^ pStream, String^ pFileNameHint, bool pInteractive)
 Inserts the content of a stream into the current planning. More...
 
unsigned int Purge (DocumentPurgeFlags pFlags)
 Purges the document. More...
 
void Audit ([Out] unsigned int% pNumErrors,[Out] unsigned int% pNumFixed)
 Audits/repairs the document. More...
 

Properties

String^  DocumentName [get, set]
 The name of the document. More...
 
LengthUnit DocumentLengthUnit [get, set]
 The document length unit. More...
 
bool ReadOnly [get]
 True if the document file was opened in read-only/write-protected mode. More...
 
bool Modified [get]
 True if the document was modified. More...
 
AcisQuality ActiveAcisQuality [get]
 The currently active acis quality. More...
 
BlockManager^  Blocks [get]
 Returns block manager. More...
 
CameraManager^  Cameras [get]
 Returns camera manager. More...
 
DimensionStyleManager^  DimStyles [get]
 Returns dimension style manager. More...
 
LayerManager^  Layers [get]
 Returns layer manager. More...
 
LightManager^  Lights [get]
 Returns light manager. More...
 
MaterialManager^  Materials [get]
 Returns material manager. More...
 
Block^  ModelSpace [get]
 Returns the modelspace block of current document. More...
 
DocumentSummary^  Summary [get]
 Retrieves the document summary, which holds additional document information. More...
 
DbDictionary^  CustomData [get]
 Allows to attach custom data to the document. More...
 

Events

GeometryUpdateEventHandler^  GeometryUpdated [add, remove, raise]
 Occurs when geometry of top level entity has been updated. More...
 
LayersChangedEventHandler^  LayersChanged
 Occurs when layers have been changed (add/remove/rename/visibility changed). More...
 

Detailed Description

Document Manager.

Member Function Documentation

void X3g::Plugin::DocumentManager::Audit ( [Out] unsigned int%  pNumErrors,
[Out] unsigned int%  pNumFixed 
)

Audits/repairs the document.

Returns the number of found and fixed errors.

IList< DbEntity^ > X3g::Plugin::DocumentManager::GetSelection ( )

Retrieves all currently selected entities.

IList<DbEntity^> ^ X3g::Plugin::DocumentManager::InsertPlanning ( String pFileName,
bool  pInteractive 
)

Inserts a planning into the current planning.

If 'pInteractive' is true, the user can interactively choose the position of the inserted objects. Otherwise the objects are placed at the document origin. The function returns a list of created modelspace entities if 'pInteractive' is false. Otherwise an empty list is returned. If 'pInteractive' is true you may react on EventType::DocumentEntitiesAdded to retrieve the inserted entities. Note that EventType::DocumentEntitiesAdded is not fired if 'pInteractive' is false.

Supported file formats: dwg, dxf, 3ds, skp, ifc, sat, sab

See Also
IAppDialogOverride::GetInsertScale
IList< DbEntity^ > X3g::Plugin::DocumentManager::InsertPlanning ( System::IO::Stream^  pStream,
String pFileNameHint,
bool  pInteractive 
)

Inserts the content of a stream into the current planning.

Parameters
pStreamAny type of input stream that contains a single file to import.
pFileNameHintIf possible, the name of the original file. This is mostly important for the suffix like ".dwg" or ".glb".
pInteractiveIf 'pInteractive' is true you may react on EventType::DocumentEntitiesAdded to retrieve the inserted entities. Note that EventType::DocumentEntitiesAdded is not fired if 'pInteractive' is false.
Returns
Depending on the imported file, the return value might be a List of one or more DbEntity.

Currently supported file streams: DWG, binary glTF v2.0 (glb).

bool X3g::Plugin::DocumentManager::LoadPlanning ( String pFileName)

Loads a planning.

Returns false if loading failed.

Supported file formats: dwg, dxf, 3ds, skp, ifc, sat, sab

See Also
IAppDialogOverride::GetInsertScale
bool X3g::Plugin::DocumentManager::NewPlanning ( )

Clears the document to start a new planning.

Returns false on fail.

unsigned int X3g::Plugin::DocumentManager::Purge ( DocumentPurgeFlags  pFlags)

Purges the document.

All unused objects will be removed. Returns the number of purged objects.

bool X3g::Plugin::DocumentManager::SaveEntities ( String pFileName,
IEnumerable< DbEntity^ >^  pEntities,
DocumentFileType  pType,
DocumentFileFormat  pVersion 
)

Saves given entities as dwg/dxf.

Returns false if saving failed.

If pVersion = Undefined the internal/loaded version of the document is used.

bool X3g::Plugin::DocumentManager::SavePlanning ( String pFileName,
DocumentFileFormat  pVersion,
bool  pCopy 
)

Saves the current planning.

Returns false if saving failed.

The planning will be saved as dxf if the file extension is .dxf, otherwise as dwg. If pCopy is true only a copy of the current document will be saved. If pVersion = Undefined the internal/loaded version of the document is used.

void X3g::Plugin::DocumentManager::SetSelection ( IEnumerable< DbEntity^ >^  pSelection)

Sets selected entities.

Property Documentation

AcisQuality X3g::Plugin::DocumentManager::ActiveAcisQuality
get

The currently active acis quality.

BlockManager^ X3g::Plugin::DocumentManager::Blocks
get

Returns block manager.

CameraManager^ X3g::Plugin::DocumentManager::Cameras
get

Returns camera manager.

DbDictionary^ X3g::Plugin::DocumentManager::CustomData
get

Allows to attach custom data to the document.

DimensionStyleManager^ X3g::Plugin::DocumentManager::DimStyles
get

Returns dimension style manager.

LengthUnit X3g::Plugin::DocumentManager::DocumentLengthUnit
getset

The document length unit.

String^ X3g::Plugin::DocumentManager::DocumentName
getset

The name of the document.

(Usally the path to the file the document was opend from).

LayerManager^ X3g::Plugin::DocumentManager::Layers
get

Returns layer manager.

LightManager^ X3g::Plugin::DocumentManager::Lights
get

Returns light manager.

MaterialManager^ X3g::Plugin::DocumentManager::Materials
get

Returns material manager.

Block^ X3g::Plugin::DocumentManager::ModelSpace
get

Returns the modelspace block of current document.

The modelspace block is the block which contains all toplevel 3d space elements.

bool X3g::Plugin::DocumentManager::Modified
get

True if the document was modified.

bool X3g::Plugin::DocumentManager::ReadOnly
get

True if the document file was opened in read-only/write-protected mode.

DocumentSummary^ X3g::Plugin::DocumentManager::Summary
get

Retrieves the document summary, which holds additional document information.

Event Documentation

GeometryUpdateEventHandler^ X3g::Plugin::DocumentManager::GeometryUpdated
addremoveraise

Occurs when geometry of top level entity has been updated.

This event may also be raised when DbEntity::UpdateGeometry is called.

LayersChangedEventHandler^ X3g::Plugin::DocumentManager::LayersChanged

Occurs when layers have been changed (add/remove/rename/visibility changed).