Will Posted May 29, 2015 Share Posted May 29, 2015 I am developing a PIO, but I’m encountering what seems to be a bug in the plug-in definition. The PIO is defined like this: [img:center]https://dl.dropboxusercontent.com/u/2804259/Files%20shared%20for%20conversations/2015.05.29/PastedGraphic-3.png[/img] With these properties: [img:center]https://dl.dropboxusercontent.com/u/2804259/Files%20shared%20for%20conversations/2015.05.29/PastedGraphic-2.png[/img] Note that in the screen shot above “Requires 3D” is set, but it does not appear to be possible to draw the path which defines the PIO on any other plane apart from the layer plane and if I try to rotate to another plane after drawing I get this error: [img:center]https://dl.dropboxusercontent.com/u/2804259/Files%20shared%20for%20conversations/2015.05.29/PastedGraphic-1.png[/img] I have the same problem if I create the plugin as a point object. |t doesn’t seem logical that you can set "Requires 3D” but it is only possible to draw something on the layer plane. I would expect a 2D path based PIO to be able to draw on any arbitrary working plane as the normal 2d path tool can. Thanks for any insight anyone can give on this. Quote Link to comment
Miguel Barrera Posted May 29, 2015 Share Posted May 29, 2015 The definition is correct. You can only draw a 2D path on a 2D plane even if the existing view is other than the top view. The reason you are getting the error is because the 2D path can only be rotated about the axis perpendicular to the plane it is drawn. Normally, if the path is drawn on the x-y axis, then you can only rotate it about the z axis. In order to rotate it about the other axes, you will need to convert the 2D path to a 3D curve such as a 3D polygon or NURBS curve or create a 3D solid such as extrude along path. Quote Link to comment
Miguel Barrera Posted May 29, 2015 Share Posted May 29, 2015 The definition is correct. You can only draw a 2D path on a 2D plane even if the existing view is other than the top view. The reason you are getting the error is because the 2D path can only be rotated about the axis perpendicular to the plane it is drawn. Normally, if the path is drawn on the x-y axis, then you can only rotate it about the z axis. In order to rotate it about the other axes, you will need to convert the 2D path to a 3D curve such as a 3D polygon or NURBS curve or create a 3D solid such as extrude along path. Quote Link to comment
Will Posted May 29, 2015 Author Share Posted May 29, 2015 It seems it always forces you to draw on the layer plane. How do I set up a PIO which allows me to draw a path with points which are coplanar on any given working plane? Quote Link to comment
Will Posted May 31, 2015 Author Share Posted May 31, 2015 OK a bit more detail. Automatic working plane doesn't work with PIO's but if you set the working plane then immediately use a 2d path PIO it works.... until you try to extrude something within that PIO. I've tried the code here http://developer.vectorworks.net/index.php/VS:BeginXtrd but this doesn't seem to work. Any ideas anyone? Quote Link to comment
JBenghiat Posted May 31, 2015 Share Posted May 31, 2015 Hybrid PIO's can't insert on an alternate plane (when you extrude, it becomes hybrid). You may be able to get the plane of the path and manually adjust your 3D geometry accordingly. If you are creating a true top/plan view (as opposed to a schematic for the 2D view), you also have to adjust the plan view to match the rotated plane. -Josh Quote Link to comment
Will Posted June 1, 2015 Author Share Posted June 1, 2015 Thanks Josh. Maybe I'm being dense, but it seems like there aren't any functions for transforming the 3D geometry from one plane to another like the Transformation in Sketchup. Do I need to construct all the matrix concatenations manually or am I missing something? Quote Link to comment
Will Posted June 1, 2015 Author Share Posted June 1, 2015 No, it seems I don't need a single matrix defining the transform, I need to get the matrix of the working plane of the 2d path and somehow break this down into 3d move and 3d rotate commands to get the extrusion back onto the same plane as the original poly. Any ideas? Quote Link to comment
Miguel Barrera Posted June 1, 2015 Share Posted June 1, 2015 You need to create the extrude in one plane and then rotate about any of the x,y, or z axes to get the orientation that you want. I usually construct in the x-y plane which would look as the object was lying on the floor and then I rotate it about the x axis to orient the object as an elevation (x-z plane). It may be beneficial if you can construct the object manually in a blank file first. Then export the object as a script. The script is accurate most times and the best way to test for it is to import the script back into a blank sheet. If it looks like the original, then the code is correct. Quote Link to comment
Miguel Barrera Posted June 1, 2015 Share Posted June 1, 2015 You need to create the extrude in one plane and then rotate about any of the x,y, or z axes to get the orientation that you want. I usually construct in the x-y plane which would look as the object was lying on the floor and then I rotate it about the x axis to orient the object as an elevation (x-z plane). It may be beneficial if you can construct the object manually in a blank file first. Then export the object as a script. The script is accurate most times and the best way to test for it is to import the script back into a blank sheet. If it looks like the original, then the code is correct. Quote Link to comment
Will Posted June 2, 2015 Author Share Posted June 2, 2015 Thanks for the tip about the export as script command, I didn't know about that before it's really useful. Quote Link to comment
Will Posted June 3, 2015 Author Share Posted June 3, 2015 OK so I'm using SetWorkingPlaneN to set the working plane. Then extruding a rectangle then a creating a path based PIO using a duplicate rectangle. The extrusion from the first rectangle is created correctly on the working plane. The extrusion from the second rectangle inside the PIO is created incorrectly on the layer plane. Outside PIO this is the result of calling vs.GetEntityMatrix on the rectangle: b:True offset:(-0.0, -0.0, -0.0) xAngle:-135.0 yAngle:-90.0 zAngle:0.0 This is the result of calling vs.GetEntityMatrix on the exact same rectangle used to create the PIO: b:False offset:(0.0, 0.0, 0.0) xAngle:0.0 yAngle:-0.0 zAngle:0.0 Is there any way to get the entity matrix of the plane the PIO is drawn on? Thanks, Will Quote Link to comment
Will Posted June 3, 2015 Author Share Posted June 3, 2015 There seems to be no way to get the entity matrix of the plane that the plugin is supposed to be on. From inside the redraw event on a PIO, calling vs.GetEntityMatrix(handleToPIOinstance) never returns anything other than 0 for the xangle or y angle. vs.GetPlanarRef(handleToPIOinstance) always returns 0 for the plane ref. I thought of creating a dummy object outside the PIO in the onObjectInitX event and storing the offsets and angles in plugin parameters but, if the plugin is moved or rotated, then if it gets reset the entity matrix will be out of date. .... Quote Link to comment
Will Posted June 3, 2015 Author Share Posted June 3, 2015 There seems to be no way to get the entity matrix of the plane that the plugin is supposed to be on. From inside the redraw event on a PIO, calling vs.GetEntityMatrix(handleToPIOinstance) never returns anything other than 0 for the xangle or y angle. vs.GetPlanarRef(handleToPIOinstance) always returns 0 for the plane ref. I thought of creating a dummy object outside the PIO in the onObjectInitX event and storing the offsets and angles in plugin parameters but, if the plugin is moved or rotated, then if it gets reset the entity matrix will be out of date. .... 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.