AW@WAdesign Posted June 15, 2016 Share Posted June 15, 2016 Hi All-- I've discovered that I can navigate sheet layers with multiple viewports if I turn off "Project Screen Objects" however, I need to turn on "Project Screen Objects" when I print. I'm looking to create two simple scripts that will do the following: Fast View Mode: 1) Select all viewports on the sheet 2) Toggle ON "Display Planar Objects" 3) Toggle OFF "Project Screen Objects" 4) Deselect all Failed attempt: DSelectAll; SelectObj(INSYMBOL & INVIEWPORT & (T=VIEWPORT)); SetObjectVariableBoolean(122, 1005, False); SetObjectVariableBoolean(122, 1035, True); DSelectAll; Print Mode: 1) Select all viewports on the sheet 2) Toggle ON "Display Planar Objects" 3) Toggle ON "Project Screen Objects" 4) Deselect all Failed attempt: DSelectAll; SelectObj(INSYMBOL & INVIEWPORT & (T=VIEWPORT)); SetObjectVariableBoolean(122, 1005, True); SetObjectVariableBoolean(122, 1035, True); DSelectAll; Any help would be greatly appreciated! Thanks, Andy Quote Link to comment
AW@WAdesign Posted June 16, 2016 Author Share Posted June 16, 2016 If it's possible, it would be preferable to toggle these options on all viewports on all sheet layers within the file at the same time. (Global file operation as opposed to sheet based operation). Again, any help would be greatly appreciated. Thanks, Andy Quote Link to comment
MullinRJ Posted June 17, 2016 Share Posted June 17, 2016 Hello Andy, In your calls to SetObjectVariableBoolean() you placed "122" in the slot where a HANDLE variable to the ViewPorts should go. 122 is the type of a VIEWPORT and doesn't point to anything. Since you appear to be new to VectorScript I've attached a short script that demonstrates how to access each VP in your drawing. Use it as an example and modify it to do other tasks. The basic format is the same for many global tasks. Also, read the VS documentation on the set of ForEachObject calls. They are very powerful for walking through a file and selecting objects of interest. PROCEDURE VPProjScreenON; { Set "Project 2D" ON for each ViewPort in the drawing. } CONST Proj2D = True; { True = ON, False = OFF } procedure SetProj2D(H :Handle); Begin SetObjectVariableBoolean(H, 1005, Proj2D); { VP Project 2D } SetObjectVariableBoolean(H, 1035, True); { VP Display Planar } SetDSelect(H); End; { SetProj2D } BEGIN DSelectAll; ForEachObject(SetProj2D, T=VIEWPORT); { do this to each VP in the drawing } END; Run(VPProjScreenON); In this script, the call ForEachObject() gets a handle to each VP, one at a time, and passes it to the procedure SetProj2D(). All the detail work is done in SetProj2D(). Duplicate this program and set the CONSTANT Proj2D to FALSE to make a script that turns the setting OFF. One caveat, this script is only mildly tested. Use at your own risk and start out on a copy of you drawing first. Have Fun, Raymond Quote Link to comment
AW@WAdesign Posted June 17, 2016 Author Share Posted June 17, 2016 Raymond, thank you! Incredibly helpful. And thanks to your very helpful explanation, I was able to modify slightly to turn off the "project screen objects." Seems to work well in my files. Thank you and take care, Andy PROCEDURE VPProjScreenOFF; { Set "Project 2D" OFF for each ViewPort in the drawing. } CONST Proj2D = FALSE; { True = ON, False = OFF } procedure SetProj2D(H :Handle); Begin SetObjectVariableBoolean(H, 1005, Proj2D); { VP Project 2D } SetObjectVariableBoolean(H, 1035, True); { VP Display Planar } SetDSelect(H); End; { SetProj2D } BEGIN DSelectAll; ForEachObject(SetProj2D, T=VIEWPORT); { do this to each VP in the drawing } END; Run(VPProjScreenOFF); Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.