Jump to content

GioPet

Member
  • Posts

    98
  • Joined

  • Last visited

Everything posted by GioPet

  1. Hello, I have been working on a few Python Scripts that use third party libraries - for example BeautifulSoup4. I intend to Encryption this script into a vsm plugin so that the external libraries are bound to it and can be used on other installations of Vectorworks. I realised that the Encryption/Obfuscation method through Vectorworks is not able to bind the external packages into the vsm file: I've included the path to these libraries in the Script Options and I am using the steps indicated by Vlado in this post for the related xml file. <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin> <Package> <File>code/__init__.py</File> <File>bS4/</File> <File>bS4/__init__.py</File> <File>bS4/.py</File> <File>bS4/diagnose.py</File> <File>bS4/element.py</File> <File>bS4/testing.py</File> <File>bS4/builder/__init__.py</File> <File>bS4/builder/_html5lib.py</File> <File>bS4/builder/_htmlparser.py</File> <File>bS4/builder/_lxml.py</File> </Package> </Plugin> Can any one advise on how to resolve this? Thank you in advance. Giovanni
  2. I am working on a simple Dialog with a set of Radio Buttons - depending on the selection, the script will perform different sub-procedures. I can't find a VS command to get the selected Radio Button. Any suggestion? thanks in advance! Giovanni
  3. Hi all, in order to help the organisation of classes, I have developed a plugin that keeps your drawing structure organised when you paste objects from other drawings. If you merge incoming classes with the existing ones, the plugin remembers your associations so that you won't have to clean up your file ever again when you import objects from external consultants or other projects. This works well if you have started using AutoClassing at some point later on, and your drawings have a mix of custom and auto classes. You'll find a detailed explanation of how you can manage your classes with this tool here: [video:youtube] To download, visit https://www.smartpaste.co.uk/ I hope this helps! all the best Giovanni
  4. Hi Tui, thanks for the reply and the feedback! Most functions are available in the Free version of SmartPaste, which can is still a great addition to a simple workflow. I'll be soon posting some videos on how SmartPaste can automatically merge classes to match your structure when importing DWG/DXF files from Autocad. all the best Gio
  5. Hello everyone! I am excited to announce the recent release of SmartPaste 3.2 which features several new functions. SmartPaste is a plug-in tool that prevents the automatic creation of classes every time objects are pasted from a drawing to another, while giving you great control over your class structure in a very easy step. On this page: https://www.smartpaste.co.uk/sample-page/new-features-explained/ you will find a detailed explanation of how this plugin will maintain your drawings organised at all times while you paste content from other drawings and you won't ever need re-structure drawings from external consultants. Depending on your needs check out SmartPaste Free, SmartPaste or SmartPaste PRO. The following Vectorworks languages are supported: Chinese, Dutch, English, French, German, Italian, Japanese, Norwegian, Portuguese, Spanish. You may also take a look at some free tools for your workflow here: https://www.smartpaste.co.uk/intuitive-tools/ Looking forward to receiving your feedback and comments all the best Giovanni
  6. That's great Dieter I am sure there will be lots to talk about! g
  7. Thanks Josh, I will follow your indication and see if I can solve it like that, if not, I will re-code in Python entirely and avoid the problem all together. Either way I will post my results here for future reference. G
  8. Yes, I am mixing the two languages and it's working very well if don't encrypt anything, but i understand it's not ideal. My intention is to re-write my entire code in Python in near future, but this will take me a while as the algorithm is quite elaborate (and I am still working on my Python skills) So, before I jump entirely in Python, I am mixing the two languages for an important step-release of my plug-in that requires Python functions, while I leave most of the code in VS.
  9. Hi Dieter, If I understand correctly, I can leave the $INCLUDE .px files in my main VS script and move all my python code in one single .py file (this is then called by PythonExecute by the main VS script). Then I write the xml to package the vsm file and the py, what about the .px that are called with $include? should they also be added in the xml? Can I then encrypt the .vsm file using the cmd+opt+shift+CAPS method on from within Plug-in Manager? Many thanks G
  10. 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...
  11. 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
  12. 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
  13. 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
  14. Wow, this is really useful, so much easier.. thanks for sharing Dieter G
  15. 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 )
  16. thanks Dieter, I also had a quick look at your Dlibrary, very useful stuff! g
  17. ok, I get it now I have to revert to the native functions: fo = open(path, 'w') fo.write(string); fo.close()
  18. 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
  19. 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.
  20. 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..
  21. 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..
  22. 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.
  23. 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
  24. 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
  25. Nice suggestion! I'll try implementing for my plug-in too. G
×
×
  • Create New...