Lesson 6.1 – Creating A New Drawing

You need to be logged in to view this content. Please login or become a member.

<<  Prev   |   Index   |   Next  >>

Description

This lesson covers, in two parts, the five main interfaces related to drawing automation: IDrawingDoc, ISheet, IView, IAnnotation, and ITableAnnotation. The creation of a fairly complex drawing is automated using these five interfaces.

Notes

In order to determine the type of view (e.g., drawing sheet, standard view, section view, etc.) use IView::Type. This is particularly useful with methods like IDrawingDoc::GetViews, which treat the sheet itself as a drawing view.

If you need to traverse all components in a view, use IView::RootDrawingComponent to get the IDrawingComponent interface and then use IDrawingComponent::GetChildren. More simply, if you only need to traverse visible components then use IView::GetVisibleComponents.

The current drawing sheet (whether the top-level or the sheet format level) always has an active sketch. If you need to get the top-level sheet sketch then use ISketchManager::ActiveSketch and for the sheet format ISheet::GetTemplateSketch. Both return an ISketch object.

Lesson Files

Lesson 6.1 start code
Lesson 6.1 code
Code snippets

Questions and Comments

You must be logged in to post a comment.