Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

13 Good

1 Follower

About PatW

  • Rank

Personal Information

  • Location

Recent Profile Visitors

684 profile views
  1. Vs errors are basically prints and no real exceptions, no way to catch them. For what reason do you need developer mode enebaled then? If it's just to show some prints you can put a link to the output on your desktop and disable dev mode: C:\Users\admin\AppData\Roaming\Nemetschek\Vectorworks\2020\ErrorOut.txt
  2. Check in the script editor(top right) that PPython is the selected Language I supsect you have VectorScript selected. regards, Patrick
  3. You could populate a recordfield with all the string (comma seperated) and acces it from outside. regards, Patrick
  4. PatW


    Hi Chansson, it was intended to work like this, but I just noticed that "Get Gravity Center" is returning 0 always for groups. Take a look at the Marionette Object examples where the group is the control geometry.
  5. What does the error say?
  6. Seems like VW does not offer a function but you could try this hack: - Convert the line into a temp. Solid (extrude along path) - Intersect it with the other solid: http://developer.vectorworks.net/index.php/VS:IntersectSolid By the error you should be able to tell if the objects intersect. regards, Patrick
  7. No problem, you can find it in <VW Programfolder>\Plug-Ins\Marionette.vwr\Scripts\. Just open the VWR with a zip program like 7Zip.
  8. Here is the implementation from the Marionette.py 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 regards, patrick
  9. sry, oversaw that you already found doms post.
  10. Hi Takeshi, I asume you checked a parametric record, in this case the number would be "3". Did you see the different tables in the doc. Data Record: -"4" Text (Didn't check it, but the pop up must be text in that case, ) -"8" Number-fractional Param Record: - "3" Number (Equivalant to 8 off Data Record) - "8" Pop-Up regards, Patrick
  11. In case no one comes up with a better solution you could try it by checking the referenced files for the symbol. When the symbol you want to check is in the resource list off the file it should be referenced. (I assume that ther ewould be conflict when you reference a file that has sym "A" and sym "A" is already in the master file). VectorWorks::TVWArray_ReferencedFileInfo outRefFilesInfo; gSDK->GetReferencedFilesInfo(outRefFilesInfo); VectorWorks::SReferencedFileInfo info = outRefFilesInfo.GetAt(0); // Iterate trough the total count info.winFilePathName; // Build a resource list and check if the Symbol is contained. http://developer.vectorworks.net/index.php/VS:BuildResourceListN regards, Patrick
  12. Hi Jim, this command moved to the context menu and is now called "Customize Truss Sysmbol Data.."
  13. Hi Ivers, here is a little example that gives you the count off the dataTag objects. What you need to do is simply replace the counting by the set class function: crit = "((R IN ['Data Tag']))" count = 0 def callback(h): global count count += 1 vs.ForEachObject(callback, crit) vs.AlrtDialog("Counted ", count, " DataTags")
  14. PatW

    VWStaticTextCtrl SetColor

    We are using VW2020. auto statTX = GetStaticTextCtrlByID(kedtitDim_EffLengthBasket); Uint8 R = 255; Uint8 G = 0; Uint8 B = 0; CRGBColor color(R, G, B); statTX->SetColor(color, false /*atDialogInitTime*/ ); I was calling this in DispatchEvent and OnUpdateUI without any effect. What we want is to make the static text red dynamically when a value is invalid.
  15. I was not able to change the color with this funciton(also SetStyle is not working) is there any trick or alternative function?


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