
This method loads an external drawing file into the control at an exact scale 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.)
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.
Returns the following according to the situation:
The recommended convention is passing the control identifier directly:
Copy Code |
|---|
(Odcl_BlockView_LoadDwgToScale 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:
Copy Code |
|---|
(Odcl_BlockView_LoadDwgToScale ProjectFile [as String] DialogName [as String] ControlName [as String] sDwgFileName [as String] [Optional] nPresetView [as Integer] [Optional] rZoomFactor [as Real] ) |
Copy Code |
|---|
; Load the drawing and set the camera from the top (Odcl_BlockView_LoadDwgToScale MyProject_MyForm_MyControl "Structural - Metric.dwg" 0) |