|
Dhatch 4.5
I have made some tests and play with MTEXT.
so i've decided to add MTEXT as a Dynamic Menu and allow user to play with.
You will see on this animated GIF the MTEXT entity changing Dynamicly
(Font and Text color when activate or not.) and following the
Grdraw line color changing from Red to blue when the option is activated
I've forced the ARIAL font to have a good text looking.
To select press SPACEBAR
To Activate the option press Enter
you can Switch Pattern by pressing TAB or Shift+TAB (reverse)
you can move your mouse to update Dynamicly the Hatch or...
press "V" at anytime to enter any Value for Angle, scale, rotation, Origin (as list), and even Pattern Name.
Dhatch create a List of all available Hatch Pattern on Acadiso.pat or acad.pat depending the
Measurement variable. All custom Hatch Pattern Found will be added to this list.
Hatch will be Associated if entity is selected.
By playing with MTEXT....This give me an Idea (just for test)..
Create Dynamic Menu with DropDown who can read XML files..(eg *.cui)
But time is missing a bit here....and i'm not that familar to XML.
so if someone is interested...I'm curious to see.
any comment will be appreciated.
(file updated 22 Jan 2009)
Last edited by andrea.andreetti; 2009-01-22 at 10:20 PM.
Waw, it is nice upgrade. much more nicer performance by using MTEXT with background.
you always have ideas beyond the common direction.
I will consider to add such feature in the new DynamicArray programming.
Just a query, why not use a "right-click" instead? See this code, with a mouse right-click a pop-up appears at the cursor showing the different options:Code:(defun c:Test_GRRead (/ res pt1 pt2 stat) (setq pt1 (getPoint "Pick initial point: ") pt2 pt1 res t stat "Angle" ) ;_ end of setq (prompt "\nMove cursor, Right-click for menu or press key: ") (while res (setq res (grread t (+ 1 2 4 8) 0)) (grtext -2 (strcat (rtos (distance pt1 pt2)) " << " (angtos (angle pt1 pt2)))) (grtext -1 stat) (cond ((= (car res) 2) (alert (strcat "You've pressed the\n\"" (chr (cadr res)) "\" key."))) ((= (car res) 3) (alert (strcat "You've left clicked\n" (vl-princ-to-string res)))) ((= (car res) 5) (redraw) (setq pt2 (cadr res)) (grdraw pt1 pt2 2 1) ) ((= (car res) 25) (setvar "DYNPROMPT" 1) (initget "Angle Scale Pattern Color File Exit") (setq stat (getkword (strcat "Select an Option [Angle/Scale/Pattern/Color/File/Exit] <" stat ">: "))) (if (= stat "Exit") (setq res nil)) ) (t (alert (strcat "Code\n" (itoa (car res)) "\n" (vl-princ-to-string res)))) ) ;_ end of cond ) ;_ end of while (princ "\Closing.") (redraw) (princ) ) ;_ end of defun
Pleasure.
Just checked. My code shows an alert if anything happens which is not catered for ... also an alert to show what key is pressed.
Unfortunately the grread function doesn't read special keys, only those with an ASCII / Unicode. From my code I did notice if you hold down Ctrl+Up Arrow this gives an u with Diaresis (ü), but it only works while the Ctrl is depressed (Alt and Shift don't work this way). And also the Function keys F1 to F12 are only working in some cases.
So stuff like arrows, or even function keys aren't read in grread. The only way I think this can be read is through VBA. Or maybe an ARX. If someone can write the ARX for this then you only need load it and call that function instead of grread. I think the VBA route would be a bit problematic as Lisp & VBA don't mix too well.
Looks like a few people are have a lot of fun and working together...
Great lead and team work guys...
Please keep it up...
This reminds me of a song...
*****
TAG TEAM BACK AGAIN...
Upgraded version of DynamicHatch 1.5
Dialog is provided to switch between valid hatch patterns, auto-load PAT file can also be set.
Change hatch type between Gradient hatch and Common hatch