ObjectDCL Banner

BlockView_LoadDwg (Using Preset Views) Method

Description

This method loads an external drawing file into the control for display just as the BlockView control displays other blocks. This method will allow the camera viewing angle to be set by a standard preset (SW, NW, Top, Front, etc.) When this method is called the block will always be zoomed to its extents unless the zoom factor argument has been submitted.

If the zoom factor has been included then the block is scaled according to the zoom extents. For example: 1.0 = zoomed to extents, 0.5 = 1/2 the zoom extents making the block half the size and 2.0 = doubles the extents making the block zoomed in.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
sDwgFileName
String identifying the drawing file name.
nPresetView
Integer identifying the preset view. The valid values are:
  • 0 (Top)
  • 1 (Bottom)
  • 2 (Right)
  • 3 (Left)
  • 4 (Front)
  • 5 (Back)
  • 6 (South-West - isometric)
  • 7 (South-East - isometric)
  • 8 (North-West - isometric)
  • 9 (North-East - isometric)
rZoomFactor
Real identifying the zoom factor to apply.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found or does not support this function.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_BlockView_LoadDwg 
		MyControlReference [as Reference]
		sDwgFileName [as String]
		[Optional] nPresetView [as Integer]
		[Optional] rZoomFactor [as Real]
	)

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_BlockView_LoadDwg
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		sDwgFileName [as String]
		[Optional] nPresetView [as Integer]
		[Optional] rZoomFactor [as Real]
	)

Applies For

BlockView.

Example

CopyCode imageCopy Code
; Load the drawing and set the camera from the top
(Odcl_BlockView_LoadDwg MyProject_MyForm_MyControl "Structural - Metric.dwg" 0)