Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by GioPet

  1. Hi Dieter, yes, I have tried vs.Chr(38) but it behaves in the same way: The following displays correctly: amp = vs.Chr(38) vs.AlrtDialog(vs.Concat('ampersand = ', amp)) but when i use concatenation (either vs.Concat or python native +) AlrtDialog doesn't display the ampersand. Bu then I used the concatenated string to make a http call I realised that all my ampersand were there as expected...
  2. Hi all. I have always used the method mentioned by matt71: http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=169223 this has always worked well for VS scripts but since I have started implementing python in some of my VS, I encounter the same problems discussed in this thread. I have followed Vladislav steps using the xml file, however when I use the command 'Encrypt Script' I get an .xxt file. Changing the extension in the encryption dialog does not work, and the xxt file is not read as a plug-in by Plug-in Manager. ..How do I get my script to be encrypted as a vsm/vso/vst?? this is pretty crucial problem, thanks in advance for any help G
  3. 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
  4. 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
  5. Wow, this is really useful, so much easier.. thanks for sharing Dieter G
  6. 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 )
  7. thanks Dieter, I also had a quick look at your Dlibrary, very useful stuff! g
  8. ok, I get it now I have to revert to the native functions: fo = open(path, 'w') fo.write(string); fo.close()
  9. 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
  10. 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.
  11. 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..
  12. 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..
  13. 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.
  14. 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
  15. 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
  16. Nice suggestion! I'll try implementing for my plug-in too. G
  17. 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
  18. Thanks TIm! this looks great, definitely an interesting direction to investigate! will keep you all posted on results. G
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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!
  25. 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!


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...