马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Program DescriptionThis function will return a vector list encoding a supplied text string, expressed in pixels relative to the origin, suitable for use with the AutoLISP grvecs function. If utilised within a grread loop (as demonstrated by the demo programs below), this enables the display of vectorised text on-screen (and beside the cursor) in real-time. The grvecs list returned by this function may also be manipulated to display text in a standard DCL dialog, as demonstrated by the GrDialog Demo program, available for download above. The LM:GrText function is also independent of Visual LISP and will hence work in all versions of AutoCAD. Demonstration ProgramsThe following examples demonstrate the various uses of GrText, from displaying simple text entered by the user, to coordinate and area read-outs, progressing to other more complex implementations. A selection of the demonstration programs shown here may be downloaded from the link at the top of this page. Please ensure the GrText.lsp function is loaded before running the following demo programs.
Demo Program 1This simple example program prompts the user to type a message and will display the entered text in real-time beside the cursor as the text is entered.
Demo Program 2This program will dynamically display the coordinates of the cursor position beside the cursor as it is moved across the screen. The coordinates are expressed in WCS using the active settings of the LUNITS & LUPREC system variables. This example program also demonstrates the speed of the LM:GrText in generating the vector list for a given string.
Demo Program 3This program prompts the user for a base point and displays the area of the rectangular region enclosed by the base point and cursor in real-time as the cursor is moved across the screen.
Further ExamplesThese additional examples are not included in the set of downloadable demonstration programs but show additional applications for the LM:GrText function. The following animation shows the function used in a program to display the area and perimeter of a selected region in real-time:
Another example demonstrating the use of the function in a dynamic array program:
GrDialog Demo ProgramThis example program is also available for download from the link at the top of the page and demonstrates how the LM:GrText function may be utilised to display text in a standard DCL dialog.
|