Jump to content

Will

Member
  • Posts

    159
  • Joined

  • Last visited

Everything posted by Will

  1. 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. ....
  2. 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
  3. Thanks for the tip about the export as script command, I didn't know about that before it's really useful.
  4. 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?
  5. 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?
  6. 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?
  7. 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?
  8. 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.
  9. Just got around to trying this and it works. This answer helped a lot, thanks. By the way for anyone else out there having problems, note that if you use this technique any mistakes you make in importing modules can show up as pretty obscure errors. I had a problem where I was missing an __init__.py and the error thrown was completely unrelated.
  10. I think it already does this. Have you tried the "rotate plan" command? It's at the top of the drawing window just to the right of the top/plan drop down menu. I think you can save it as a saved view if you want to go back to this rotation.
  11. I would like to be able to set up a load of drawing sheets with drawing borders, logos etc all inserted. Save the file as a stationary file in the workgroup default content folder and then use them to create new drawings with borders all set up and ready to go from the "new sheet layer" option in the layers drop down menu. Currently only the page setup is imported, not the items drawn on the sheet layer.
  12. Classes should be more like tags in the mac finder (as of OS X Mavericks). You can apply multiple tags to things. When you use a 'wall' tool the thing gets tagged as (wall), same with roof tool (roof). But as all these objects are actually the same, the connect/combine tool, the push pull tool, the reshape tool all work consistently on them. Edit 2: Heres what tags look like in OSX finder: Your classes (tags) palette has a search bar and you can save a search which is then acted on to show hide or grey stuff. E.g. '(Hide^) all tagged (wall) + (roof) + (door handle)' where (Hide^) is a little 'pill' with drop down menu that allows you to select from show/hide/grey. 'pills' for class names autocomplete when you type them so they are easy to find, just like finder tags in OS X Mavericks. While you are drawing tags are assigned the same way as classes are now. E.g you would have (Services)+(Electrical)+(HV line) selected as your current tags and whatever you are drawing would be tagged with all of these. Some tag names are reserved by vectorworks and are always applied when you use specific tools. E.g. (wall) (roof) (slab) Then, for example, if you want to see all the services but nothing else. You could have this active in your classes pallet: (Show^) all tagged (Services) Or if you want to find all the roofs for a worksheet its the same interface to set up the search E.g. (Show) all tagged (Roof). You could also have an option to automatically create a list of all the tags with a show hide option so it wouldn't look too different to how it is now for the old timers who hate change. Edit: Just in case anyone is wondering what I mean by pill:
  13. Can we have the ability to insert repeating objects into a wall component? Something a bit like the current curtain wall option. I would like to be able to show e.g. repeating cladding modules, structural framing, battens and counter battens etc. Ability to show in 2D, 3D or both.
  14. Why are walls roofs and slabs all different kinds of objects with different tools for cutting holes and inserting symbols? Conceptually they can all be defined by a shape on a plane which is extruded and offset a couple of times to form a wall out of a series of layers. Just have one thing, call it a composite linear object or something. Then we wouldn't have to wait for you to update the roof object with features that the wall tool has had for years. :-)
  15. I would like to be able to push pull the height of a wall and even better, individual components of a wall.
  16. So I tried this vectorscript and the result is the same: PROCEDURE Example; VAR h1: HANDLE; BEGIN MoveTo(0,0); LineTo(100,100); h1 := CreateCustomObjectPath('Renderworks Camera', LNewObj, NIL); END; RUN(Example); Anyone got any ideas? Is it a bug?
  17. Thanks for replying. None is the python language 'null object' so I'm guessing its equivalent to NIL but I'm not sure as it's not really documented anywhere, so far as I can tell. The vector script example on the page for CreateCustomObjectPath shows NIL as the argument for this function, I'm not sure what a renderworks camera would use a profile group for is so I'm guessing I don't need one but don't know for sure. I'll try setting various fields using SetRField. I'm not sure what fields I can set that will help with the zero length camera object though. I'll also try the same script in vector script and see what happens. Thanks W
  18. Hi All, I'm trying to create a Renderworks Camera from script like this: pos = (0,0,0) ang = 45 vs.MoveTo(pos) v = vs.Ang2Vec(ang, 1000000) vs.LineTo( pos[0]+v[0], pos[1]+v[1] ) path = vs.LNewObj() cam = vs.CreateCustomObjectPath( "Renderworks Camera", path, None) But I get this error: Error on line=1: _313 _60 - The object described has zero size. It cannot be created Error on line=1: _218 _224 - Error trying to convert string to number. And then a camera is created which appears to be based on a line length of 0 and has various problems when I try to use it. Can anyone see what I'm doing wrong? Is a line the wrong kind of path to use for creating a linear object? Should I be using CreateCustomObjectPath or CreateCustomObjectN, both have similar errors? Thanks for any help Will
  19. Does anyone know what a valid mask is for GetFileN? By trial and error I have discovered that "*.JPG" is valid but this is case sensitive and so it doesn't allow selecting .jpg files. Is there any way to have more than one file extension? I was guessing something like shell globbing "*.{JPG,jpg}" or regexp "[JPG|jpg]" would work but they don't. Any ideas? Thanks Will
  20. 2D 3D hybrid symbol enhancement: Page scale for 2D. World scale for 3D. Then electrical symbols can be readable at different scales. But the 3D element of the symbol will be the right size.
  21. Please at least background the vector hidden line generation even if you can't make it multi core.
  22. I don't call print() in the code executed through vectorworks, only in the interactive shell in my terminal which am a using to demonstrate that the python code is correct and has works as intended when called by the official python 3.3 interpreter. It wouldn't make any difference if was calling vs.Message() or print() from the script executed in vectorworks because it barfs on the import statement before it has had a chance to get that far. I can import single files individually, but I want to nest one module inside another and this doesn't work. Have you tried importing a module which imports another module? I'm on OS 10.9 Are you running on windows or a different OS X?
  23. I think I found a bug in the Vectorworks implementation of the python interpreter which prevents it loading packages correctly. To reproduce: You should have a directory structure that looks like this: ~/vspython/ pytest/ __init__.py sub/ __init__.py a.py b.py The contents of file a.py should be: import sys import pytest.sub.b def callFinB(): return pytest.sub.b.syspath() The contents of file b.py should be: import sys def syspath(): return("Message from b") In a blank file create a new script palette Create a new script in the script palette and set the language to python. Click the scripting options button and add the ~/vspython directory to the python path Paste the following into the script: from pytest.sub import b from pytest.sub import a a.callFinB() Click OK to close the script window to save. Double click the script in the script palette to execute it. I get an error. However, in an interactive python3 session I get the expected results as you can see here: Bonobo:CAD scripts will$ python3 Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 16 2013, 23:39:35) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from pytest.sub import b >>> from pytest.sub import a >>> print(a.callFinB()) Message from b >>> The only workaround I can find is to put the entire contents of the script in one file and only import this.
  24. Yes, thats what I thought at first but it has no trouble finding the vs module when its imported from __init__.py so this can't be the problem. It might be some subtlety of how the python imports modules but I have done extensive googling and I can't find a problem which is the same as this, some very similar but not this exact problem with importing an external module twice....
×
×
  • Create New...