ObjectDCL Banner

BlockView_DisplayBlockToScale (Using Camera Offset) Method

Description

loads a block from the current drawing or pre-loaded dwg file into the control for display at an exact scale.  This method will allow the camera viewing angle to be set manually by submitting the offset vector camera placement in relation from the center of the block.

To set the exact scale the zoom factor argument can be calculated as Units per Pixel. So for example a 10 inch by 10 inch block displayed with a value of 0.5 will display about 20 pixels by 20 pixels (+ or - one pixel) in size in the control.

ZoomFactor = Actual Units / ScreenUnits 

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.
sBlockName
String identifying the block by name.
rCameraXOffset
Real identifying the X-axis offset of the camera.
rCameraYOffset
Real identifying the Y-axis offset of the camera.
rCameraZOffset
Real identifying the Z-axis offset of the camera.
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_DisplayBlockToScale 
		MyControlReference [as Reference]
		sBlockName [as String]
		rCameraXOffset [as Real]
		rCameraYOffset [as Real]
		[Optional] rCameraZOffset [as Real]
		[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_DisplayBlockToScale
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		sBlockName [as String]
		rCameraXOffset [as Real]
		rCameraYOffset [as Real]
		[Optional] rCameraZOffset [as Real]
		[Optional] rZoomFactor [as Real]
	)

Applies For

BlockView.

Example

CopyCode imageCopy Code
; Display this block
(Odcl_BlockView_DisplayBlockToScale MyProject_MyForm_MyControl "Block1" 10 5)

See Also

BlockView_DisplayBlockToScale (Using Preset Views)