TiTaNiuM sAMuRai Posted February 4, 2003 Share Posted February 4, 2003 I'm guessing that I set the view to a 2D view, draw the 2D version, then set the view to a 3D view and proceed with the 3D elements, right? When executing the PIO, would VW be smart enough to show only the 3D stuff in a 3D view and only the 2D stuff in plan view? For moving around in the 3D symbol, I use SetView, I suppose? Quote Link to comment
Guest Posted February 4, 2003 Share Posted February 4, 2003 The script for a VectorScript Plug-in Object should simply create all of its sub-objects. It should not change the view or attempt to separate the 2D from the 3D sub-objects. Hybrid Plug-in Objects work much the same way as hybrid Symbols. They may contain both 2D and 3D sub-objects in any order. When VectorWorks displays the object, it will sort through the sub-objects and only display the appropriate objects depending on the current view setting. Quote Link to comment
TiTaNiuM sAMuRai Posted February 4, 2003 Author Share Posted February 4, 2003 Thanks a million for the quick reply. Two issues I still have though, are: 1) I don't want VW to go through the hassle of calculating 2D elements if they don't get drawn anyway. I separate the 2D and 3D code so that only the relevant code is executed. How do I determine whether or not I'm in Plan view? 2) How do I create extrudes that are extruded from different directions? Quote Link to comment
Alexandre Villares Posted February 5, 2003 Share Posted February 5, 2003 don't bother to do 1) it simply isn't how it is suposed to work. Now, about 2): You have to rotate your extrudes after creating them. As in this example I've writen: code: Procedure SillyWindow; VAR objectName,objectClass : STRING; objectHand, recordHand, wallHand: HANDLE; {Parameters used: LINELENGTH & BOXWIDTH (from the rectangular PIO) E (thickness) & A (height from floor) } BEGIN {-----------2D part-----------} Rect (0,PBOXWIDTH/2, PE, -PBOXWIDTH/2); Rect (PLINELENGTH-PE,PBOXWIDTH/2, PLINELENGTH, -PBOXWIDTH/2); IF GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand) THEN BEGIN objectClass:=GetClass(objectHand); NameClass(objectClass); END; FillColorByClass; FPatByClass; LWByClass; LSByClass; PenColorByClass; {plan view rect} Rect ( 0, -PBOXWIDTH/2,PLINELENGTH,PBOXWIDTH/2); HMoveBackward(LNewObj, TRUE); {FALSE=Backward TRUE=Back} {-----------3D part-----------} BeginXtrd(0,PBOXWIDTH); Rect (0,0, PLINELENGTH, PE); Rect (0,PA-PE, PLINELENGTH, PA); Rect(0, PE, PE, PA-PE); Rect(PLINELENGTH-PE, PE, PLINELENGTH , PA-PE); EndXtrd; Set3DRot(LNewObj,90,0,0,0,0,0); Move3DObj(LNewObj,0,PBOXWIDTH/2,0); END; Run(SillyWindow); [/code] [ 02-04-2003, 07:25 PM: Message edited by: Alexandre B A Villares ] Quote Link to comment
TiTaNiuM sAMuRai Posted February 5, 2003 Author Share Posted February 5, 2003 But if the 2D portion of the script is massive, that's a huge amount of code parsed for naught when in a 3D view. There MUST be a way to check IfPlanView();... Thanks anyway. Quote Link to comment
Alexandre Villares Posted February 5, 2003 Share Posted February 5, 2003 Samurai, Remember the PIO is not redrawn on every view change. So the code does not run so often... Quote Link to comment
matto Posted February 5, 2003 Share Posted February 5, 2003 yep it's good to remember that your PIO is only redrawn if edited, moved or rotated, depending on your settings for the PIO. that is if the object is moved not the view. VW stores that info like a hybrid symbol between redraws. so if you only run the script part for the view the other part will be mising if the user changes view. (sort of if you draw just the 3d the top view of the 3d will appear in plan view). generally for each instance of the PIO the script will only ever run once. Quote Link to comment
Jason33 Posted February 8, 2003 Share Posted February 8, 2003 I have put a BOOLEAN paramater in a PIO for drawing the 3D or not, and then contained the 3D part in a Large conditional statement. this seemed to work fine for me, and cut down on the "calculating" time for the PIO. -jason 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.