Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Hull and Outfitting

Defining Draft’s Area (2D) Views

  • Last UpdatedNov 13, 2025
  • 2 minute read

setup form !!MyForm . . .

 ...

 view .DrawingAT . . .AREA

  height 20 width 40

  put /SITE1/SHEET

  limits 200 100 TO 600 500

 exit

 ...

exit

define method !!MyForm( )

 -- form constructor method

 ...

 -- initialize AREA view gadget

 !this.drawing.borders = true

 !this.drawing.background( ‘beige’ )

 !this.drawing.highlight( ‘red’ )

 ...

endmethod

The area occupied by borders and scroll bars is within the size you specify for the gadget.

To define the colour items are displayed in when picked with the left‑hand mouse button, use the .sethighlight() method with one of the standard Draft colour numbers or colournames.

The contents of the view may be any valid 2D graphical element, such as an Draft SHEET, VIEW, LIBRARY, To define the contents of the view, use the put command thus:

Command

Effect

put CE

Draws the current element

put /SITE1/SHEET

Draws the named Sheet element

If you put new content into an area view that already contains a drawing, the original content will be replaced by the new, not added to it.

Note: There is currently no .put() method! So to replace the view contents you will need to use the old PML1 syntax:

edit view !!MyForm.drawing AREA put /site/sheet2

The maximum limits for the drawing, such that only part of the specified content is drawn (giving, in effect, a window on the overall content area), may be set using the limits keyword as above or using the .limits() member in the form’s constructor method, as follows:

!box[1] = 200

!box[2] = 100

!box[3] = 600

!box[4] = 500

!this.drawing.limits = !box

where the limits define two opposite corners of the required area in sheet co-ordinates.

For a full list of VIEW members and methods, see the Software customization Reference Manual.

Related Links
TitleResults for “How to create a CRG?”Also Available in