Jump to content

Paolo

Member
  • Content Count

    86
  • Joined

  • Last visited

Community Reputation

37 Great

1 Follower

About Paolo

  • Rank
    Apprentice

Personal Information

  • Occupation
    Designer
  • Homepage
    https://fitplot.it/vwplugins/
  • Hobbies
    Vectorscript, Python, Objective C developer
  • Location
    Italy

Recent Profile Visitors

951 profile views
  1. Is there someone that can test the marionette node contained in this file (it should install PIL python module in the user folder) on Vectorworks 2020 SP4 on Windows? Download PIL.vwx It worked some time ago, it does not anymore. Something has changed with the recent SP4 (maybe) and the VerifyOrGetLib() seems to refuse to install python modules. I have checked (on Mac) and VerifyOrGetLib() is identical to SP3 version (see the code in the first post). The bug should reside in pip3.exe, since the ret_code is 1 (what does it mean?), see code below. I have no way to test it by myself, cause I am on Mac (and Mac does not have this problem…) any help? @Marissa Farrell, @JBenghiat, @relume if sys.platform == 'win32': piploc = 'Python35\Scripts\pip3.exe' pathpip = 'Python35\Scripts' cdpath = os.path.join(appfolder, pathpip) cmdpip = os.path.join(appfolder, piploc) wd = os.getcwd() if os.path.exists(cmd) and os.path.exists(cmdpip): os.chdir(cdpath) ret_code = subprocess.call([cmdpip, 'install', missingLibURL, '-t', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.') exit_code = False else: exit_code = True sys.path.append(cmd + '\\') os.chdir(wd) vs.AlrtDialog('Module ', missingLib, ' has been successfully installed.')
  2. I distribute a plugin written in Python that makes use of the PIL module. To import the module I use the Marionette function VerifyOrGetLib() as seen in some marionette examples from Marissa Farrell and others. if platform == 2: #windows PIL = 'https://pypi.python.org/packages/bb/f7/d644a9a65a25ff0bf43b7f69ce3ef9803742a5d6e438ddfc7e925c007e6c/Pillow-7.1.2-cp35-cp35m-win_amd64.whl#md5=6d62274af5c88c1cfe31c977f7531ed6' else: #Mac PIL = 'https://files.pythonhosted.org/packages/7d/b4/755848342213bcb5a5c570657ca21f20ebc104daf15d7847b08e18b4d2fd/Pillow-7.1.2-cp35-cp35m-macosx_10_10_intel.whl' if Marionette.VerifyOrGetLib('PIL', PIL): Now I am receiving messages from some Windows users saying the installation fails. Unfortunately I am on a Mac and cannot test it directly. While the directory Python Externals is correctly created inside the user folder a message is shown saying that the module cannot be downloaded. But the above link, if copied directly in a browser, indeed download a 2Mb file (Pillow-7.1.2-cp35-cp35m-win_amd64.whl) Here's the code of the VerifyOrGetLib() (contained in the Marionette module) def VerifyOrGetLib(missingLib, missingLibURL): # try to install user's package exit_code = False appfolder = vs.GetFolderPath(1) appuserfldr = vs.GetFolderPath(12) cmd = 'Python Externals' cmd = appuserfldr + cmd if not os.path.exists(cmd): os.makedirs(cmd) try: try: importlib.import_module(missingLib) exit_code = True except ImportError: #show dialog here question = 'Python module ' + missingLib + ' is not installed. Would you like to download and install it now?' res = vs. AlertQuestion(question,'', 1,'','','','') if res == 1 : if sys.platform == 'win32': piploc = 'Python35\Scripts\pip3.exe' pathpip = 'Python35\Scripts' cdpath = os.path.join(appfolder, pathpip) cmdpip = os.path.join(appfolder, piploc) wd = os.getcwd() if os.path.exists(cmd) and os.path.exists(cmdpip): os.chdir(cdpath) ret_code = subprocess.call([cmdpip, 'install', missingLibURL, '-t', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.') exit_code = False else: exit_code = True sys.path.append(cmd + '\\') os.chdir(wd) vs.AlrtDialog('Module ', missingLib, ' has been successfully installed.') elif sys.platform == 'darwin': import pip import shlex pos1 = missingLibURL.rfind('/') pos2 = missingLibURL.rfind('whl') downloadedfile = missingLibURL[pos1+1:pos2] +'whl' destination = appuserfldr + downloadedfile command_line = "curl -o " + '\"' + destination + '\"' + " "+ missingLibURL args = shlex.split(command_line) ret_code = subprocess.call(args) if ret_code == 0: sys_executable_orig = sys.executable sys.executable = '/usr/bin/python' ret_code = pip.main(['install', destination,'-q','--target', cmd]) sys.executable = sys_executable_orig if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be installed.') exit_code = False else: vs.AlrtDialog('Module ', missingLib, ' has been successfully installed.') exit_code = True else: vs.AlrtDialog('Module ', missingLib, ' cannot be installed.') exit_code = False sys.path.append(cmd+'/') else: exit_code = False except: pass return exit_code Is someone experiencing the same problem? Any help is wellcome!
  3. Thank you JBenghiat, just tested and it works! r, offset, rotationXAngle, rotationYAngle, rotationZAngle = vs.GetEntityMatrix(imageHandle) rotationZAngle is the image (imageHandle) rotation value (the same showed in the OIP)
  4. I’ll give it a try, thanks 🙂
  5. Did you forget to take some measures during your last architectonical survey? That's a bummer! But, wait… You've got some pictures? Then Plumb-Bob's got your back! Plumb-Bob is a perfect completion for your architectural survey! Everything you need is an image (even one taken from your phone), in which four known key points are clearly visible. Here's what you can do with Plumb-Bob: You can obtain the Plumb-Bob plugin for just €10+ via the Gumroad® platform at my personal page or starting from the plugin dedicated page here below: https://fitplot.it/vwplugins/PlumbBobPlugin.html
  6. Hello all, is there a way to get the rotation angle of an image (bitmap) inserted in Vectorworks? The angle is clearly shown in the OIP but it seems to be unreachable by code 🤔 Here's what I tried: vs.HAngle(h) This returns always 0. I also searched in the appendix for some documented index to get the angle, but found nothing… vs.GetObjectVariableReal(h, index) Also tried to get it from record fields… vs.GetParametricRecord(h) but Bitmaps are a native type and not plugin objects, so neither this worked… Other ideas / suggestions?
  7. Ready, at last! Plumb-Bob for Vectorworks is available on the Gumroad® platform at €10+. You can get it from the official page here: https://fitplot.it/vwplugins/PlumbBobPlugin.html or from my Gumroad® page here: https://gumroad.com/pamarcu Note for Vectorworks italian users: This same plugin should be included in the next Vectorworks update (italian version) , under the name Ortofoto. Hope you enjoy it, Paolo
  8. I am about to release PlumbBob for Vectorworks here's a brand new demo video with all the features of the plugin:
  9. I am almost ready to release my PlumbBob for Vectorworks version, here's the new Plugin Icon:… …and a screenshot of the plugin in action: Purpose of the Plugin: Starting from a picture, and knowing 4 points on it (for example a window's four corners), it is possible to rectify the picture so that you can take exact measurements of all openings lying on the plan to which the points (window in the example) belong. Also the plugin does the same operation on 2D objects traced on the picture (points, lines, polygons etc.) Also the plugin is able to do the reverse operation, transporting bitmaps and 2D objects from the rectified plan to the original picture point of view. While I had way to develop and test it on my Mac version of Vectorworks 2020, I still need someone to try it on Windows. This test is needed since the program relies on Pillow, a python library (for image manipulation) that is downloaded and installed (at first run) in the user library of Vectorworks. Please, if you are interested in testing PlumbBob (and get it for free, of course), leave me note (mouse over my icon and click ✉️Message). I'll provide to send you the plugin and necessary instructions. Thank you in advance
  10. There is a new updated version of the Mouldings plugin here: Mouldings Plugin version IV for Vectorworks 2019-2020 and here's the new mouldings manual links: Mouldings manual (PDF) or Mouldings manual (EPUB)
  11. If all white pixels become transparent, well, this is not so good. In the PNG with alpha there could be white pixels that must remain opaque! I have to test it… I fear, in the end, I have to show up the import dialog to the user, instructing him to choose PNG with ALPHA option…
  12. Thank you JBenghiat, it works! Even importing a PNG (with alpha) as JPEG, it maintains its transparency. It appears filled with white, but IT CAN BE set to fill none! I was (for years) convinced that JPEGs couldn't have alpha channels, but I was wrong 🤔
  13. Hello, Is there a way to programmatically import an image as png with alpha channel, without showing up the import dialog as in: def vs.ImportImageFileN(filePath, importPt, mode): return HANDLE I am aware of: def vs.ImportImageFile(filePath, importPt): return HANDLE but I am wondering if there is a way to force the default import preferences (JPEG) as PNG with ALPHA channel. This is needed in my perspective rectifier plugin, where a new image (PNG with ALPHA) is created and imported on the fly.
  14. Hello, I am working on a perspective rectifier for Vectorworks 2020, based on my application PlumbBob (on the Mac App Store). Description: The plugin (it's a Plugin, not a tool) works on 4 key points on the plan in perspective that are known and must not be collinear. Points are placed on the picture moving the 4 (moveable) crosshairs. Once crosshairs are placed, it needs to fill the key points in the OIP panel with their value in the real world. We assume that P1 is the origin (0,0) then we proceed in CCW with P2, P3 and P4. Then we add the picture itself to the selection (shift-click), we select the individual edit mode (top right in the OIP) and we click on the arrow (left or right) until the plugin is visible in the OIP again (see video). Finally, clicking on the "Select & transform image" will perform the rectification, placing the new created image with the indicated (0,0) point in the drawing origin, at drawing scale. I am searching for someone who can test it for me on Vectorworks 2020 for both Windows and Mac platforms. Also I'd like to hear your opinion / suggestion about 🙂 Thank you, Paolo
  15. Vectorworks® plugins, symbols and scripts © Paolo Marcuccetti 2020 A collection of digital products for Vectorworks®, some for free and some for a fee! New Barroom symbols Bar rooms (full package) includes about 400 symbols 2D/3D, gathered in 11 files (Vectorworks® 2020). These symbols are all originally made by me (based on real objects) in my 20 years experience in the bar room / retail design. You can purchase the full package or single packages or even single symbols. Paid products are sold on: https://gumroad.com/pamarcu

 

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