DphFormat::Format Class Reference

List of all members.

Detailed Description

Main Interface to the drawing format.

The Format class provides the interface to:

Creating a Format object can be done using a tag_t obtained from the legacy UG/Open C API or a DrawingSheet object.


Public Member Functions

Construction
 Format (tag_t drawing)
 Format (NXOpen::Drawings::DrawingSheet *drawing)
Operations
void addBorder (const std::string &borderId, const std::string &sizeId)
void setBorderSize (const std::string &sizeId)
void deleteBorder ()
void updateBorder ()
 Updates the border definition to current one on disk.
BlockPtr insertBlock (const std::string &blockId, const std::string &styleId="", const std::string &locationId="")
void deleteBlock (const std::string &blockId)
void deleteBlock (const BlockPtr &block)
Query
std::string borderId () const
std::string sizeId () const
std::string zone (const NXOpen::Point3d &point) const
BlockList blocks ()
BlockPtr getBlock (const std::string &blockId)
bool hasBlock (const std::string &blockId)


Constructor & Destructor Documentation

DphFormat::Format::Format ( tag_t  drawing  ) 

Create a Format object

Parameters:
[in] drawing UG/Open API tag of drawing

DphFormat::Format::Format ( NXOpen::Drawings::DrawingSheet *  drawing  ) 

Create a Format object

Parameters:
[in] drawing the drawing to work with


Member Function Documentation

void DphFormat::Format::addBorder ( const std::string &  borderId,
const std::string &  sizeId 
)

Add border to drawing

Parameters:
[in] borderId the ID of border to add
[in] sizeId the ID of the size to use
Note:
If drawing already has a border, it will be replaced.

BlockList DphFormat::Format::blocks (  ) 

Get list of blocks on drawing

Returns:
the blocks currently on drawing

std::string DphFormat::Format::borderId (  )  const

Get id of border on drawing

Returns:
the border ID(empty string if none on drawing)

void DphFormat::Format::deleteBlock ( const BlockPtr block  ) 

Delete a block

Parameters:
[in] block the block to delete

void DphFormat::Format::deleteBlock ( const std::string &  blockId  ) 

Delete a block

Parameters:
[in] blockId the ID of the block to delete

void DphFormat::Format::deleteBorder (  ) 

Delete the border from drawing

Note:
This method also removes all blocks from drawing.

BlockPtr DphFormat::Format::getBlock ( const std::string &  blockId  ) 

Get a specific block on the drawing

Parameters:
[in] blockId the block ID of the block to retrieve
Returns:
the block on the drawing
Exceptions:
std::runtime_error no block with ID on drawing

bool DphFormat::Format::hasBlock ( const std::string &  blockId  ) 

Query if block is on drawing

Parameters:
[in] blockId the block ID of the block to query

BlockPtr DphFormat::Format::insertBlock ( const std::string &  blockId,
const std::string &  styleId = "",
const std::string &  locationId = "" 
)

Insert a block on the drawing

Parameters:
[in] blockId the ID of the block to insert
[in] styleId the ID of the style to use(empty string will use default)
[in] locationId the ID of the location to use(empty string will use first one found)
Returns:
the block that was inserted
Note:
The drawing must already have a border on it.

void DphFormat::Format::setBorderSize ( const std::string &  sizeId  ) 

Change the size of border

Parameters:
[in] sizeId the ID of the size to use

std::string DphFormat::Format::sizeId (  )  const

Get id of the size of the border

Returns:
the size ID of border(empty string if no border on drawing)

std::string DphFormat::Format::zone ( const NXOpen::Point3d &  point  )  const

Get the zone ID of a drawing location

Parameters:
[in] point the point to get zone location of
Returns:
the zone ID
Note:
The returned string will be empty if:
  • No border on drawing
  • Zone information of border is incomplete


Generated on Mon Oct 16 10:42:45 2006 for Delphi NX Drawing Format API by  doxygen 1.4.7