Jump to content

GioPet

Member
  • Content Count

    87
  • Joined

  • Last visited

Everything posted by GioPet

  1. Hi Dieter, yes I tried that.. What turned out is that the & was actually concatenated in the string, but for some reason vs.AlrtDialog does not display it. as I was using vs.AlrtDialog to check the string, it took me a while to figure out that actually & was there.. and thanks once more for your TIP, it's all very appreciated as I've still got so much to learn about Python! G
  2. I have found no way to resolve concatenation with '&' symbol, as it is ignored in the concatenation by both vs.AlrtDialog(vs.Concat()) and + I have also tried the folloinwing: amp = str.replace('&', '%26') but no success. any suggestion? g
  3. Wow, this is really useful, so much easier.. thanks for sharing Dieter G
  4. I have used DB6 to generate a simple layout and exported it for Python. The dialog runs perfectly in when I export it in VS, but python reports errors with the following functions: dialog = vs.CreateLayout( GetStr('dialog_title'), True, GetStr('ok_button'), GetStr('cancel_button') ) ERROR: TypeError: Can't content 'int' object to str implicitly vs.CreateGroupBox( dialog, kUnnamed4, GetStr(kUnnamed4), TRUE ) ERROR: NameError: global name 'TRUE' is no defined These appear to be bugs in how DB6 exports the Python code. For anyone who has the same problem, I solved it with the following: dialog = vs.CreateLayout( GetStr(3), True, 'ok_button', 'cancel_button') vs.CreateGroupBox( dialog, kUnnamed4, GetStr(kUnnamed4), True )
  5. thanks Dieter, I also had a quick look at your Dlibrary, very useful stuff! g
  6. ok, I get it now I have to revert to the native functions: fo = open(path, 'w') fo.write(string); fo.close()
  7. Hi all, I am new to Python and I am testing a few functions. I am trying to get this done: vs.Rewrite(filename) vs.WriteLn(string) vs.Close(filename) but it always returns the error: AttributeError: 'module' object has no attribute 'WriteLn' all variables are correctly defined... so what am I doing wrong? thanks g
  8. Thanks for jumping in Dieter! I just realised that the LObject definition is different between function reference VW2015 and VW2016 .. I was obviously looking at the old one.. I understand now why my code with LObject makes the script work when there is only one Layer in the document.. so, I have replaced LObject with LNewObj, which works for the parts of my code where objects are created by vectorscript. My script starts with a call to the rectangle tool - CallTool(-203) - then i need to get the handle to the rectangle created by the user, which LSactLayer does correclty.
  9. I can't find SymLoc in the vectorscript functions reference.. on the other hand, I need to read the center of the bounding box because that's where I want a new rectangle to be created (then move/edit it from there through other functions). doing some more testing, I realised that the function that is not 'working' properly is LObject (to get the handle of the last object created) - it returns a point with crazy coordinates, therefore I get the problem getting HCenter for the last created object.. Exactly the same code works 100% fine with drawings that have been newly created with Vectorworks 2016..
  10. I tried centering the drawing on the Internal Origin and setting the User Origin to the Internal Origin. Unfortunately it did not resolve the problem..
  11. Yes, the two documents are saved with the same version, but one is newly created and the other has been converted from a Vectorworks 2009/2010. I tried the following to rest all objects and their bounding box, but the issue still remains: PROCEDURE RESETIT; FUNCTION ForAll(Hnd: HANDLE) :BOOLEAN; BEGIN SetSelect(Hnd); ResetObject(Hnd); ResetBBox(Hnd); END; { ForAll } BEGIN DSelectObj(All); ForEachObjectInLayer(ForAll, 0, 2, 1); END; RUN(RESETIT); Rather than the issue with copying objects between two documents, my main problem is that the function RectangleN is not capable of creating a rectangle when I use HCenter to get the coordinates of an existing object in the document which I want for the insertion point for the new rectangle.
  12. When using files created with an older version of Vectorworks (or from an old template file) I have come across this problem: - if I use HCenter to get the coordinates of a handle, then create a rectangle in that point using RectangleN, the function doesn't work at all. - The coordinate values in the old drawing have 4digits before decimal point and 10 digits after. If I copy and paste in place the same rectangle into a new document, the coordinates in the new documents have 5 digits and no decimal point at all. The Document Settings and Unit settings of the two files are identical.. so there seems to be a problem with the X and Y values of points in the drawing space of old drawings. Does anybody know anything about this behaviour and how to resolve this problem?? thanks for any suggestion G
  13. Hi all, SmartPaste & Intuitive Tools for Vectorworks 2016 are now available! - SmartPaste is a plug-in designed to maintain the class structure of all drawings consistent when content is copied from other files, allowing to merge any new class with the existing ones or to add them. Download of SmartPaste Trial from this link - Intuitive Tools are a set of simple plug-ins that allow easier access to very frequent functions in order to simplify the personal workflow. The Intuitive Tools can be downloaded for free from this link all the best! G
  14. Nice suggestion! I'll try implementing for my plug-in too. G
  15. Dieter, thanks for pointing that out. I can see what you mean when you say it's easier to create an object rather than editing it. So I resolved it creating of the object with insertion point but, for this particular plug-in I worked on, the position of some of the objects is calculated in relation to the size/dimensions/position of previously created objects and in some instances it becomes easier to Duplicate+offset rather than figuring out the new insertion point. thank you all for all the tips. G
  16. Thanks TIm! this looks great, definitely an interesting direction to investigate! will keep you all posted on results. G
  17. Hi Dieter, no worries, I appreciate you asking for more info to help figure this out. I am working on a plugin tool that generates a series of graphic objects (rectangles and circles) and distributes them within a rectangular area defined by the user. The size, rotation and position of the objects are governed by a series of variables that are set by the user (with a sub -tool that writes the variables on a file). although it sounds not particularly useful, this plugin is to be used for a very specific workflow. If I was able to set the indicator of the bounding box at the center, then I could easily combine the variables (previously entered by the user) to set position, width and height of the objects by using the duplicate command. > this would be an easy thing. Otherwise, I will have to create a series of equations to determine all coordinates of new objects. I might be approaching this from the wrong programming-poin-of-view, so any comment is welcome. G PS: I haven't had a chance to try Kevin's suggestion
  18. as in your signature, a bit of sudoku is always good! thanks fir checking the SDK! i think I better get started with my equations... G
  19. Hi and thank you both for your comments. Hippocode: for what I am trying to achieve it is actually ok that the setting is global and affects all objects. Kevin: thanks for suggesting the functions SetCustomObjectSelectionGroup\GetCustomObjectSelectionGroup What I am trying to accomplish is to be able to set the indicator of the bounding box to the center so that I can use SetWidth and SetHeight to change the size of an object without the position of the object to change. .. in this way I could work around without having to resize by calculating the new coordinates object (hope that make sense) Thanks G
  20. I am looking for a function to get/set the indicator of the Bounding Box of an object. I couldn't find one in the resource library.. Any suggestion/help would be greatly appreciated! G
  21. Hi twk! Thanks for suggestion! SmartPaste for Vectorworks 2016 will be released in the next couple of weeks, i will notify via new post in the 3rd Party Services-Products forum! g
  22. Hi, I have created two Toolsets which is similar to the Visibility Tool, with the difference that each option (turn on/off class/layer, make class/layer active or invisible) can be accessed individually. These tools are a bit more 'direct' than the visibility tool as they can be assigned with a one-key shortcut so that they very easy to activate. The toolsets are available for download this from this URL: https://www.smartpaste.co.uk/#free-tools I hope this can be useful!
  23. Hi, I found it useful to create a custom plug-in that creates a rectangular Viewport crop which by default is created on the None class and its line attribute is set to white. In my workflow I always leave the None class switched on, so that the crop is always visible, and thanks to my plug-in I avoid the risk to create a viewport on other classes. This plugin is free to download this URL: https://www.smartpaste.co.uk/#free-tools I hope it helps!
  24. Dear Vectorworks users, I have recently released the new version of SmartPaste and Intuitive Tools, custom plugins created to support a more efficient workflow: SmartPaste & IntuitiveTools SmartPaste allows to maintain the structure of all your drawings consistent every time you Copy/Paste across different drawings: It’s great when working in larger teams or using drawing templates. IntuitiveTools are a set of free plugins created to streamline particular functions that can be easily used with single-key shortcuts: they are very handy if you work with a pen tablet as you can easily associate the IntuitiveTools with buttons on your tablet. This Community Board has been a great resource and inspiration for the development of these plugins, therefore I have created a coupon code for the users of the this Community Board who wish to download SmartPaste free of charge: coupon code at checkout: vw_community this code is valid until the 31st December 2015. If would like to download SmartPaste at a later date, please contact support@smartpaste.co.uk Best Wishes to all Giovanni
  25. I work with VW 2009 running on a Mac OS X. I realized that when using a tool, Ctrl+Click normally allows to select different Objects without having to de-select and re-select the tool in use. However, the Mac OS overrides the vectorworks Ctrl+click behavior with the default Ctrl+click=mouse right click. I couldn't find a way around this problem. Does anyone know how? either by changing the Mac OS or the Vectorworks behavior? thanks

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...