Jump to content

relume

Member
  • Posts

    59
  • Joined

  • Last visited

Reputation

4 Neutral

Personal Information

  • Location
    Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello In layer organisation and layer definition mask there is a new option to enable and set georeference. When importing geo-referenced esri shape data the layer to which the data is imported is set to be geo-referenced. Assigning by vectorscript (python) objects from the shape import to newly created destination layers - layers also created by vectorscript those newly created destination layers are not geo-referenced. I can check if the source layer is geo-referenced by vs.IsGeoreferenced(layer_handle) but I am not able to set/enable the newly created destination layers to be geo-referenced. It seems that the the function vs.SetGISLayer(layer_new_handle) does "nothing". Maybe vs.SetGISLayer is not the correct function, but I can not find any other function or Layer-Settings-Option/Selectors that would accomplish this. Many thanks for any idea.
  2. Hello Vlado Many thanks again, I appreciate very much your considerations.
  3. Hello Vlado Thank you very much for your response. That clarifies what I was assuming – but hopped it is not the case. But it is the reason why in VW python "sys.excecutable" on the MacOS/darwin plattform is pointing to the VW app, and why "pyhton" and "pip" are not exectuable on the command line inside the darwin VW app package/bundle (error : missing python image). It would makes only sens to install an additional python installation inside the VW app/bundle, if this will replace the internal VW python environment to run the scripts. But after some days finally I was able to install 3.5.2 and get it run as standard installation on the MacOS . This 3.5.2 standard system installation is only used to get the rigth modules (like geopandas and some related modules) installed an be used in VW (installed on '~/Library/Application Support/VectorWorks/2020/Python Externals'). But I have also to say that python 3.5.2 is for lot of modules a critical version. Python 3.5.3 is much less critical - but module versions loaded with 3.5.3, were incompatible with 3.5.2. Thus I would very appreciate, if in VectorWorks a more recent version of python would be embedded - at least the latest version of an allready EOL minor version - for python 3.5 > 3.5.9. But meanwhile python 3.7 is very common, not pointing to python 3.8. Many thanks again and best regards, relume
  4. Hello JBenghiat Thank you very much for your message. Yes I had allready carried out the same steps as your hints, prior to post the topic. Finally I could resolve the problem with the 3.5.2 installer that was broken for a outdated SSL certificate (with pip it was not possible any more to get the python "pypi.python.org" cache for looking about python packages. Neither it was possible to update PIP for the same reason. Updating PIP resolved the problem: curl https://bootstrap.pypa.io/get-pip.py | python3.5 where python3.5 is the python version installed from 3.5.2 best regards, relume
  5. VectorWorks : v2020 SP2 MacOSX : 10.14.6 Hello I am facing big troubles to install some modules like "geopandas" to use them with VectorWorks 2020. Actually I can install with an external python installation version 3.5.9 (the latest version in 3.5) all needed modules. Unfortunately there are some incompatibilities (for example for "pandas") while importing against the the internal VectorWorks 2020 python version 3.5.2 and its built-in functions. So I installed a python 3.5.2 version from the official download page, but now it is not possible to locate any external module, that satisfy the requirements of version 3.5.2 and further I am getting errors that says: 1 location(s) to search for versions of rtree: * https://pypi.python.org/simple/rtree/ Getting page https://pypi.python.org/simple/rtree/ Looking up "https://pypi.python.org/simple/rtree/" in the cache Returning cached "301 Moved Permanently" response (ignoring date and etag information) Looking up "https://pypi.org/simple/rtree/" in the cache Cache entry deserialization failed, entry ignored Starting new HTTPS connection (1): pypi.org Could not fetch URL https://pypi.python.org/simple/rtree/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c: It seems that VW 2020 python version 3.5.2 is really outdated and thus it would be "best" to update the internal VW version to 3.5.9 at least. Is this feasible and how? Many thanks, relume
  6. Hello I have posted some (final) findings on the other topic pil-python-image-library-for-vw-2018. As for the problem with the before mentioned "pyspatial" module the problem is inherent to the actual version of the "pyspatial" module and the pip version that module is installed with. Other modules that use setup.py "e.g. rtree" can be installed with above (final) findings without any problems.
  7. Hello Patrick I am sorry to respond only today to your posting. Many thanks for posting the "Marionette.VerifyOrGetLib()" implementation. I previously searched in vain for the Marionette lib/package inside the VectorWorks 2020.app package (MacOS version). Where did you found the Marionette.py file? It is remarkable, that they use for the installation of modules for the MacOS/darwin plattform not the python distro that is installed inside the VectorWorks 2020.app package but the standard python installation : sys.executable = '/usr/bin/python' ret_code = pip.main(['install', destination,'-q','--target', cmd]) sys.executable = sys_executable_orig On my MacOSX 10.14.6 system "/usr/bin/python" shows version 2.7.16. VectorWorks 2020 has installed version 3.5.2. Furthermore now it became clear to me why installing the modul by pip with an subproccess call and using the value of "sys.executable" did not work and opened a new instance of VectorWorks 2020.app. On the MacOS/darwin plattform "sys.executable" does not hold the path of the internal python installation but the VectorWorks 2020.app itself: /Applications/Vectorworks 2020/Vectorworks 2020.app/Contents/MacOS/Vectorworks For that reason I tried to call directly the internal (VectorWorks 2020.app) python installation to work with it and to have the corresponding python version for installing appropriate modules. But it seems that the internal python installation is not callable and executable: dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.5/Python Referenced from: /Applications/Vectorworks 2020/Vectorworks 2020.app/Contents/Frameworks/Python.framework/Versions/3.5/bin/python3.5-32 Reason: image not found The call by "subprocess.run('...../bin/python3.5-32', '--version') results for all python bins to "image not found". So I have to assume that for VectorWorks 2020 on the MacOS/darwin plattform the internal python installation and thus the pyhton image (binary) is somewhat "hiden" or maybe compiled into a VectorWorks package (?). For that reason I installed finally for MacOS/darwin with homebrew an appropriate python 3.5.X installation which is then linked and callable to: /usr/local/bin/python3.5 or /usr/local/bin/pip3.5 thus now I have modified my own modul installation function in order also to use on the MacOS/darwin plattform the now standard subprocess function "subprocess.run" that replace all other previous subprocess functions: vVW_AppUserPy_folder = vs.GetFolderPath(12).replace(':','/') + 'Python Externals' vPython_path = '/usr/local/bin/' vPython_pip_path = vPython_path + 'pip3.5' vModule_version = '>=2.5.0' # vModule_version can be passed to pip directly behind the module name vModule_version = '' vCommand = [vPython_pip_path , 'install', '--upgrade', '-v', vModule+vModule_version, '--target', vVW_AppUserPy_folder] vPip_proc = subprocess.run(vCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE) vPip_proc_exit_code = vPip_proc.returncode vPip_proc_sdtout = vPip_proc.stdout.decode('utf-8') vPip_proc_sdterr = vPip_proc.stderr.decode('utf-8') best regards
  8. Hello in the following there is the VW log output of installing the module "pyspatial" (the same with "rtree") that does not work with the pip.main() approach and starts a setup.py "process" and a second instance of the VectorWorks.app: ... Starting new HTTPS connection (1): pypi.org https://pypi.org:443 "GET /simple/pyspatial/ HTTP/1.1" 304 0 Analyzing links from page https://pypi.org/simple/pyspatial/ Found link https://files.pythonhosted.org/packages/e2/a4/3d79183abfa1f898cfb48d858c7b31af158c4a8195f4a68acdc7f2262f26/pyspatial-0.1.0.tar.gz#sha256=0a887170be86e6ef6ef6bab8afa416cd876f9e2ddd3bef50f08213074bcf62d3 (from https://pypi.org/simple/pyspatial/), version: 0.1.0 Found link https://files.pythonhosted.org/packages/4d/4c/389f48ccacbc3914e0f3e4cc33848b090a12917b4dfec9fa6622e9425d7c/pyspatial-0.1.1.tar.gz#sha256=245c2c8d9c5ad436a01d743b7f1b40067aaa5b998178f52284affb1dd269150b (from https://pypi.org/simple/pyspatial/), version: 0.1.1 Found link https://files.pythonhosted.org/packages/26/93/adc918fa271de29f14b17de01409a29bbeb54e3ee18578ba999809787726/pyspatial-0.1.2.tar.gz#sha256=fbcec18df8d43d870e42a56f83e6286542d1bcf63bfa1e4070cb4d5dfd6a9ce6 (from https://pypi.org/simple/pyspatial/), version: 0.1.2 Found link https://files.pythonhosted.org/packages/be/8e/38680a60c87da016a67e7674088562e8cfbb1d478ef75759a2963de7fd82/pyspatial-0.1.4.tar.gz#sha256=d97fb8ca47684cd20659785a541f0e32075cdc23e134761d34e199c7aef5711c (from https://pypi.org/simple/pyspatial/), version: 0.1.4 Found link https://files.pythonhosted.org/packages/b7/9d/694cf404ea5abb10117b0d9aebaf610cddbaaf1bdc3202aa0b730d1e472f/pyspatial-0.2.1.tar.gz#sha256=612e2ee010558d14c8efaa70dad43c7c147e5b6e79eedc6eb965d61c6b568d46 (from https://pypi.org/simple/pyspatial/), version: 0.2.1 Found link https://files.pythonhosted.org/packages/eb/b3/57d3d0fc106bb1d22a9ca9b6055a2865e2f5ee9c897e3b8eb2ec91cdf23a/pyspatial-0.2.3.tar.gz#sha256=2ea43da81fa2094de99ade462430bff298778be3ca02bfc3eb5dd69e911491fe (from https://pypi.org/simple/pyspatial/), version: 0.2.3 Found link https://files.pythonhosted.org/packages/27/c8/279807519a8c76115c5bb38a454784b69513c889e50afee874470f884223/pyspatial-0.2.4.tar.gz#sha256=387e26cf08b02504ebec0ec1c137aa4331d4818ae9738210f19d40aa3261e8c9 (from https://pypi.org/simple/pyspatial/), version: 0.2.4 Using version 0.2.4 (newest of versions: 0.1.0, 0.1.1, 0.1.2, 0.1.4, 0.2.1, 0.2.3, 0.2.4) Looking up "https://files.pythonhosted.org/packages/27/c8/279807519a8c76115c5bb38a454784b69513c889e50afee874470f884223/pyspatial-0.2.4.tar.gz" in the cache Current age based on date: 152800 Freshness lifetime from max-age: 365000000 The response is "fresh", returning cached response 365000000 > 152800 Using cached https://files.pythonhosted.org/packages/27/c8/279807519a8c76115c5bb38a454784b69513c889e50afee874470f884223/pyspatial-0.2.4.tar.gz Downloading from URL https://files.pythonhosted.org/packages/27/c8/279807519a8c76115c5bb38a454784b69513c889e50afee874470f884223/pyspatial-0.2.4.tar.gz#sha256=387e26cf08b02504ebec0ec1c137aa4331d4818ae9738210f19d40aa3261e8c9 (from https://pypi.org/simple/pyspatial/) Running setup.py (path:/private/var/folders/nx/hzd6xdlj62d6xnh9n63x3cwc000mh8/T/pip-build-huwr1_vk/pyspatial/setup.py) egg_info for package pyspatial Running command python setup.py egg_info 2020-03-07 10:22:20.657 Vectorworks[14776:14547727] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null) 2020-03-07 10:22:27.183 Vectorworks[14776:14547727] Attempt to load executable of a type that cannot be dynamically loaded for CFBundle 0x7fc97843d520 </Applications/Vectorworks 2020/Plug-Ins/SketchUpWorker.vwlibrary> (executable, not loaded) [0307/102229.600319:WARNING:resource_bundle.cc(353)] locale_file_path.empty() for locale de-CH [0307/102229.600668:ERROR:main_delegate.cc(671)] Could not load locale pak for de-CH [0307/102229.606890:WARNING:resource_bundle.cc(548)] locale resources are not loaded ... [0307/102229.612772:ERROR:proxy_service_factory.cc(116)] Cannot use V8 Proxy resolver in single process mode. * Trying 134.119.159.150... * TCP_NODELAY set * Connected to vectorworks-hilfe.computerworks.eu (134.119.159.150) port 80 (#0) > HEAD /2020/index.htm HTTP/1.1 Host: vectorworks-hilfe.computerworks.eu Accept: */* < HTTP/1.1 200 OK < Date: Sat, 07 Mar 2020 09:22:32 GMT < Server: Apache/2.4.41 < Last-Modified: Tue, 14 Jan 2020 14:51:47 GMT < ETag: "6c4a-59c1abb2fc496" < Accept-Ranges: bytes < Content-Length: 27722 < Content-Type: text/html < * Connection #0 to host vectorworks-hilfe.computerworks.eu left intact 2020-03-07 10:22:36.016 Vectorworks[14776:14547727] Reachability Flag Status: -R ------- networkStatusForFlags Application start : 03/07/20 at 10:22:37 ... by this following part of the sequence (snippet from above log) the second VectorWorks.app is started up: ... Running setup.py (path:/private/var/folders/nx/hzd6xdlj62d6xnh9n63x3cwc000mh8/T/pip-build-huwr1_vk/pyspatial/setup.py) egg_info for package pyspatial Running command python setup.py egg_info ... Many thanks for any hint, relume P.S. the Marionette.VerifyOrGetLib() approach does not work really, if you do want to install libs/modules in more generalistic way like this e.g. "pip.main(install --upgrade 'dateutil>=2.5.0' and without passing the ressource URL as it is needed in Marionette.VerifyOrGetLib()
  9. Hello I am wondering if there is any documentation for the Marionette function "Marionette.VerifyOrGetLib()" with its posssible parameters. I am wondering if it is possible to get an lib/module and a specific Version with "Marionette.VerifyOrGetLib()" as with pip (e.g. pip.main('install', '--upgrade', 'dateutil>=2.5.0') thus not passing a specific ressource URL? I have the problem that for some python lib/modules (e.g. pyspatial or rtree) the pip.main() approach does not work, as on installing those libs/moduls a setup.py call is started an therefore a new instance of VectorWorks.app is started. see my other topic (installing-modules-from-within-a-script) : I am sorry for crosspointing. Many thanks, relume
  10. approachVectorWorks : v2020 MacOSX : 10.14.6 Hello I have used until now sucessfully the following code snippet to install missing modules: see also this forum entry: "PIL python image library for vw 2018" vModule = 'mymoduleToimport' pip.main(['install', '--upgrade', '-v', vModule]) # or vVW_AppUserPy_folder = '/Users/myuser/Library/Application\ Support/VectorWorks/2020/PythonExternals' pip.main(['install', '--upgrade', '-v', vModule, '--target', vVW_AppUserPy_folder]) This works for most modules. For some modules (e.g. pyspatial) this approach is not working and instead a second instance of the VectorWorks.app is started without any error (only verbose console output), but those modules are finally not installed. As far as I can see, those modules that are not working are calling the setup.py script. Is there any way to suppress this behavior? While "debugging" I learned, that in PIP > version 10 (actual PIP version is version 20, and in VectorWorks v2020 version 8.1 is installed by default), the pip.main() function is removed and the following construct should be used: vPip_proc = subprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade', '-v', vModule, '--target', vVW_AppUserPy_folder ]) vPip_proc_exit_code = vPip_proc.returncode vPip_proc_sdtout = vPip_proc.stdout vPip_proc_sdterr = vPip_proc.stderr Unfortunately this approach is not working at all for all python modules. Every time a second instance of the VectorWorks.app is started without any error and output and no module is installed. I would appreciate any hint or suggestion how to solve this problem. Many thanks in advance, relume
  11. @MullinRJ Many thanks four your hint! It seems that I did not seek the VS functions in deep 🙄. The vs.ConvertToPolygon(h, resolution) is perfect. relume
  12. Hello For external geometrical processing in a python script, every VW polygon that has one or more curved vertices has to be converted to an approximated "lines only" polygon. This represents the standard transformation for any curved vortex on exporting VW objects by the export function to the Shape-Geodata format. There is also an VW-menu functionality, that converts a polygon to a multi-line group, where curved vertices were approximated by as many needed short lines. At the moment I can not see, how I can get/convert to such a "lines only" polygon by a VS function. The idea is the following: get the handle of the VW polygon. test if there is one or more curved vertices by looping through all vertices of the polygon (using vs.GetPolylineVertex). if there is any curved vertex in the referenced polygon, make a temporal copy of the original polygon and convert this copy to a "lines only" polygon. process the "lines only" polygon as needed in the python script Step 3. is the operation I am interessted in – a "fast" and VW internal converting operation to a "lines only" polygon or a group of lines. Many thanks in advance for any hint, best regards, relume
  13. Hello I am not sure, if have understood correctly your question. However I can say the following: the progress dialog can be displayed without the vs.ProgressDlgStart() and terminated without the vs.ProgressDlgEnd() call. without calling vs.ProgressDlgClose() the dialog window stays open until the script terminates. vs.ProgressYield() has to have a numeric parameter vs.ProgressYield(1), otherwise pyhton errors are thrown. vs.ProgressYield(int) has to be called otherwise the other messages like vs.ProgressDlgSetMeter(message) are not refreshed on the dialog window. def messagePtest3(): selCount = 10 def DoTheWork(): # vs.ProgressDlgStart(100,selCount) for i in range(selCount+1): vs.ProgressDlgYield(1) vs.ProgressDlgSetMeter(str(i)) vs.Wait( 1 ) #well, we work by waiting vs.ProgressDlgOpen( "I'm about to do some work", False ) vs.ProgressDlgSetMeter("") # this resets previous values, if vs.ProgressDlgStart is not callded DoTheWork() # vs.ProgressDlgEnd() # vs.ProgressDlgClose() # if close is not called, the dialog stays open until the script terminates best regards, relume
  14. Hello Many thanks for your ready "receipe", I appreciate that very much. I hope the dataframe populating process with every single polygon vortex will not be slowed down by the VW functions calls - but it is the only way to do it. best regards
×
×
  • Create New...