Using a script to set or move an entity to a sheet
Okay, I am trying to update my scripts from CC2 to CC3, and one of them is a script that creates a Border. The script works fine, but I want to add some code to ensure that the border is also added to the correct sheet. I know I can use movesht to move the entity to a sheet and also use sset, but when I try to use either one I get an error. Here is some of the code:
SELBYP
POLY x2,y1 p2 x1,y2 x1-doff,y2+doff x2+doff,y2+doff x2+doff,y1-doff;
CHANGEFS SOLID
CHANGEC locolor
CHANGEL MAP BORDER
MOVESHT MAP BORDER
SSET;
For SSET, I am geting a "ChkDate DAV has no pending DRQ". And for movesht I get a CC3 cannot perform the command.
Any suggestions?
SELBYP
POLY x2,y1 p2 x1,y2 x1-doff,y2+doff x2+doff,y2+doff x2+doff,y1-doff;
CHANGEFS SOLID
CHANGEC locolor
CHANGEL MAP BORDER
MOVESHT MAP BORDER
SSET;
For SSET, I am geting a "ChkDate DAV has no pending DRQ". And for movesht I get a CC3 cannot perform the command.
Any suggestions?
Comments
Which is better to use in a script - SSET to set the sheet to the sheet you want and then run the script. Or to use MOVESHT to move the entity to the sheet you want?
Reason I am asking is I am updating an old script (not even sure who created it)..It makes a "Nautical Border". The script uses a lot of math so instead of updating all the created entities with a move I was thinking of the save existing sheet name..move to the one it should...do stuff...and then reset back to the sheet name.
I guess a question is does it really matter if they are created on the MAP Border sheet? I am really trying to update all the old macros and scripts I used in CC2 to take use of CC3 and it seems to me that making sure the marcos/script places the stuff on the right sheet is an important part of it. thoughts?
My grand scheme is to update all the macros and scripts I had from CC2 to be more CC3...most of the macros and scripts came from the CC2 macro email list...so if anyone wants them let me know and I will either start posting them here or email them (unless someone at Profantasy tells me that is a no no).
get the current layer
get the current sheet
set to a another layer
set to another sheet
do script work
set back to current layer
set back to current sheet
but I keep getting an error on setting the sheet with sset. Can any one help on how sset gets the sheet name. Anytime I do something like:
sset Sheetname
I get an error, but I am not sure what sset by itself does. Here is a sample of the code I am trying:
GL SheetName1 MAP BORDER
SGETNAME SheetName2
SETLAYER SheetName1
SHOWSHT SheetName1
SSET;
that works...but doesn't assign the current sheet to the SheetName1.