dcl_settings : default_dcl_settings { audit_level = 3; } //------------------------------------------------------------------------------ // Program Name: GetVectors.dcl [GetVectors R3] // Created By: Terry Miller (Email: terrycadd@yahoo.com) // (URL: http://web2.airmail.net/terrycad) // Date Created: 12-7-01 // Function: c:GetVectors explodes selected entities into lines segments and // writes vector points to C:\Temp\Vectors.lsp which may be viewed // by c:ViewVectors. //------------------------------------------------------------------------------ // Revision History // Rev By Date Description //------------------------------------------------------------------------------ // 1 TM 12-7-01 Initial version // 2 TM 5-20-04 Added dialogs to assist in creating dialog images. // 3 TM 3-20-05 Added c:Palet function to view AutoCAD's 255 colors. //------------------------------------------------------------------------------ // GetVectors is a programming tool for creating dialog images from AutoCAD // entities. The entities selected will be exploded into line segments to create // the image and dialog files C:\Temp\Vectors.lsp and C:\Temp\Vectors.dcl. // Use the function ViewVectors to view the images created by GetVectors. The // image and dialog files created by GetVectors may be pasted into your own // programs and modified as needed. //------------------------------------------------------------------------------ // Instructions: Draw a rectangle in units corresponding to the pixel units of // the image you want to create. For example to create a 100 x 100 pixel image, // draw a rectangle from 0,0 to 99,-99. Copy and scale the entities you want to // include in your image into the limits of the outlined rectangle. GetVectors // creates the blocks GetVectors and DupVectors for reference. Move the blocks // or the entities off to the side and make modifications as needed. //------------------------------------------------------------------------------ // Overview of Dialogs //------------------------------------------------------------------------------ // GetVectors - Used by c:GetVectors to create dialog file C:\Temp\Vectors.dcl // ImageAttributes - Used by c:ImageAtts to calculate the height and width of // dialog images. // Palet - Used by c:Palet to view AutoCAD's 256 colors. //------------------------------------------------------------------------------ // GetVectors //------------------------------------------------------------------------------ GetVectors : dialog { key = "Title"; initial_focus = "Edit001"; : spacer { height = 0.1; } : column { : text { key = "Text101"; label = "101"; alignment = centered; } : text { key = "Text102"; label = "102"; alignment = centered; } } : spacer { height = 0.1; } : boxed_column { label = "Image Attributes"; width = 21; : row { : column { width = 6.8; fixed_width = true; spacer; : column { : text { key = "Text001"; label = "001"; alignment = left; } } } : edit_box { key = "EditInt001"; edit_limit = 6; edit_width = 4.5; fixed_width = true; } : column { width = 6.2; fixed_width = true; spacer; : column { : text { key = "Text011"; label = "011"; alignment = left; } } } } : row { : column { width = 6.8; fixed_width = true; spacer; : column { : text { key = "Text002"; label = "002"; alignment = left; } } } : edit_box { key = "EditInt002"; edit_limit = 6; edit_width = 4.5; fixed_width = true; } : column { width = 6.2; fixed_width = true; spacer; : column { : text { key = "Text022"; label = "022"; alignment = left; } } } } spacer; : row { spacer; : toggle { key = "Toggle003"; label = "Background"; } } : spacer { height = 0.1; } } : spacer { height = 0.1; } : row { : column { : button { key = "Info"; label = "Info"; alignment = right; width = 11; fixed_width = true; } } : column { : button { key = "Help"; label = "Help"; alignment = left; width = 11; fixed_width = true; } } } : row { fixed_width = true; alignment = centered; : ok_button { width = 11; } : cancel_button { width = 11; } } }//GetVectors //------------------------------------------------------------------------------ // ImageAttributes //------------------------------------------------------------------------------ ImageAttributes : dialog { key = "Title"; initial_focus = "Edit001"; : spacer { height = 0.1; } : boxed_column { label = "Attribute Information"; : row { : column { width = 8.59; fixed_width = true; spacer; : text { key = "Text001"; label = "001"; alignment = left; } } : edit_box { key = "EditInt001"; edit_limit = 6; edit_width = 4.26; fixed_width = true; } : column { width = 8.59; fixed_width = true; spacer; : text { key = "Text002"; label = "002"; alignment = left; } } : edit_box { key = "EditInt002"; edit_limit = 6; edit_width = 4.26; fixed_width = true; } } : row { : column { width = 8.59; fixed_width = true; spacer; : text { key = "Text003"; label = "003"; alignment = left; } } : edit_box { key = "EditReal003"; edit_limit = 6; edit_width = 4.26; fixed_width = true; } : column { width = 8.59; fixed_width = true; spacer; : text { key = "Text004"; label = "004"; alignment = left; } } : edit_box { key = "EditReal004"; edit_limit = 6; edit_width = 4.26; fixed_width = true; } } : spacer { height = 0.5; } } : spacer { height = 0.1; } : ok_button { is_cancel = true; width = 11; } }//ImageAttributes //------------------------------------------------------------------------------ // Palet //------------------------------------------------------------------------------ Palet : dialog { key = "Title"; label = ""; spacer; : column { : image { alignment = centered; key = "Image"; width = 16.76;//101 height = 3.28;//43 fixed_width = true; fixed_height = true; aspect_ratio = 1; color = -2; } } : ok_button { is_cancel = true; } }//Palet //------------------------------------------------------------------------------ // widths increment by about ~0.17 per pixel (/ 1 6.0) = 0.166667 // popup_list vs edit_box = 2.5 width diff // smallest 9.09 = 6.59 // 11.42 = 8.92 same size as Cancel button // spacer, row, & column // 0.08 = 1 pixel // 0.25 = 2 pixels // 0.42 = 3 pixels // heights increment by about ~0.08 per pixel (/ 1 13.0) = 0.0769231 // horizontal_margin = none; = no left and right margins // vertical_margin = none; = no top and bottom margins // For heights for list_box // height = 2.57; = 1 line // height = 3.80; = 2 lines // height = 5.03; = 3 lines // height = 6.26; = 4 lines // height = 7.49; = 6 lines // height = 8.73; = 7 lines // height = 9.96; = 8 lines // Smallest width for a button // label = ""; width = 5.58; // For heights for spacers // : spacer { height = ?;} don't use fixed_height = true; // 0.04 = 1 pixel more than spacer; // 0.12 = 2 pixels ... // 0.20 = 3 pixels // 0.27 = 4 pixels // 0.35 = 5 pixels // 0.43 = 6 pixels // 0.50 = 7 pixels // 0.58 = 8 pixels // 0.66 = 9 pixels // 0.73 = 10 pixels // 0.81 = 11 pixels // 0.89 = 12 pixels // 0.96 = 13 pixels // 1.04 = 14 pixels ... same pattern as above //------------------------------------------------------------------------------