by Jeffrey Ma » Sun, 21 Nov 2004 05:58:03
ello Bryan,
A good way to find keyins (other than the helpfile :) is to open the keyin
browser & drag its lower-right corner down to expose the browser fields. Tag
the tables button & select the MDL you are wondering about (in your case,
PSELECT) and its 'root' keyin commands are shown in the lower-left pane. Tag
one of these, and selections for the next word (only those applicable to the
selected first word) appear. This is a good way to find those 'hidden'
command strings (that might not be in the helpfile :) for use in your
macro's MbeSendKeyin "<command>" statements. Not all MDLs are loaded at
start, some must be loaded manually for their keyins to show in the
listings. Another source is the cmdlist.h file, which you want to make a
copy of this, rename it cmdlist.txt, and peruse it in a texteditor. Under no
circumstances make any alterations to the existing cmdlist.h file! AFAIK
there is not now nor never will be a 'comprehensive-up-to-the-minute'
listing, but when all else fails, Ask Inga! www.askinga.com and select
Keyins from the Categories list.
That said, IMO you should be using selectbyattributes rather than
powerselector for your 'preprint' macro, remembering that selectby might
already be loaded, and might already have choices made in it, it might be
best to begin with:
Sub Main()
' since selectby might already be running with various changes in its state,
' first unload it, then reload it to initialize its ground-state
MbeSendCommand "MDL UNLOAD SELECTBY"
' reload selectby with clean settings
MbeSendCommand "MDL LOAD SELECTBY"
' clear the levels
MbeSendCommand "SELECTBY LEVEL NONE"
' select the desired level
MbeSendCommand "SELECTBY LEVEL 40"
' start the search
MbeSendCommand "SELECTBY EXECUTE"
' then delete the selected elems
MbeSendCommand "DELETE ELEMENT"
' unload selectby
MbeSendCommand "MDL UNLOAD SELECTBY"
' start the default command
MbeStartDefaultCommand
End Sub
Changing the date by macro would be a little more difficult, it would help
ENORMOUSLY if the date textelem has discrete attributes (a combination of
Lv, Co, Lw & Ls) that are NEVER shared with any other textelems. Then the
selectby can be set to search for the text-element type and those specific
attributes, then match the elem attributes, match the text attributes, store
the elem origin, build a string variable from the system clock, and place
the string as a textelem at the stored MbePoint.
Alternatives:
1) Keep the actual print-date on the title-block ref file(s) where only
these must be manually altered before plotting, or
2) Instead of writing the actual date in the file, place the textstring
$DATE$ in the file & use a pen table to replace it with the actual date.
Search the help for "Text Substitutions". Replace $DATE$ with _DATE_ in the
TextSubs dlog. The Windows OS will replace _DATE_ with your Windows locale
short date format (mm/dd/yyyy in USA) but this can be changed with a uStn
config var. I'll send you the details if you want to do this.
3) You could use the same pen table to 'turn off' Level 40.
The pentable filename should be specified in your plt file or plot.ini file
or as a (standards.cfg or <project>.pcf) config var - it's easier to set it
up to load automatically than it is to remember to load it manually.
HTH,
Jeffrey Malter
"Bryan" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...