Jump to content

Search the Community

Showing results for tags 'python'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Announcements
    • Announcements
    • News You Need
    • Job Board
  • Feedback
    • Roadmap
    • Wishlist - Feature and Content Requests
    • Known Issues
    • Wishes Granted / Issues Resolved
    • Forum Feedback
  • General
    • Troubleshooting
    • General Discussion
    • Architecture
    • Site Design
    • Entertainment
    • Vision and Previsualization
    • Braceworks
    • ConnectCAD
    • Energos
    • Rendering
    • Workflows
    • Buying and Selling Vectorworks Licenses
    • Hardware
  • Customization
    • AI Visualizer
    • Marionette
    • Vectorscript
    • Python Scripting
    • SDK
    • 3rd Party Services, Products and Events
    • Data Tags
  • Solids Modeling and 3D Printing
    • Subdivision
    • Solids Modeling
    • 3D Printing
  • Vectorworks in Action
  • Archive
    • Resource Sharing
    • Machine Design

Calendars

  • Community Calendar
  • Training Calendar
  • Webinars
  • Community Groups

Categories

  • Knowledgebase
    • Tech Bulletins
    • Troubleshooting
    • Workflows
    • How To
    • FAQs

Categories

  • Marionette - Objects
  • Marionette - Networks
  • Marionette - Nodes
  • Marionette - Menu Commands

Product Groups

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Occupation


Homepage


Hobbies


Location


Skype

  1. Hello I'm trying to use the following .py code in Vectorscript as a Python script. Compiling works. The application fails and the libraries are referenced. The libraries are there. what do i have to do? Thanks for your help! import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.art3d import Poly3DCollection def create_turtle_shell(mesh_points, num_layers=5, layer_thickness=0.1): """ Erstellt schalenartige Elemente um die Hülle des 3D-Objekts. Parameters: - mesh_points: Eine Nx3-NumPy-Array mit den Koordinaten der Meshpunkte. - num_layers: Die Anzahl der Schichten. - layer_thickness: Die Dicke jeder Schicht. Returns: - turtle_shell: Eine Poly3DCollection, die die schalenartigen Elemente repräsentiert. """ turtle_shell = [] for i in range(num_layers): shell_points = mesh_points * (1 + i * layer_thickness) hull_faces = create_convex_hull(shell_points) turtle_shell.append(hull_faces) return turtle_shell def create_convex_hull(points): """ Erstellt die konvexe Hülle für eine Menge von Punkten. Parameters: - points: Eine Nx3-NumPy-Array mit den Koordinaten der Punkte. Returns: - hull_faces: Eine Poly3DCollection, die die konvexe Hülle repräsentiert. """ from scipy.spatial import ConvexHull hull = ConvexHull(points) hull_faces = Poly3DCollection([hull.points[face] for face in hull.simplices], alpha=0.2) return hull_faces # Beispiel: Erzeuge zufällige 3D-Punkte np.random.seed(42) mesh_points = np.random.rand(100, 3) # Erzeuge die schalenartigen Elemente turtle_shell = create_turtle_shell(mesh_points) # Visualisierung fig = plt.figure() ax = fig.add_subplot(111, projection='3d') for layer in turtle_shell: ax.add_collection3d(layer) ax.scatter(mesh_points[:, 0], mesh_points[:, 1], mesh_points[:, 2], c='r', marker='o') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') plt.show()
  2. Hi All So I'm trying to add functionality into an already existing Event based PIO that allows the user to click a button in the OIP and choose a Lighting fixture on the drawing, and get some information from it. The bit I'm struggling with is finding a way to use vs.GetPt() (or any similar user interactive command) within a Python Event based plug in object. The structure of the Plug In is pretty standard, the main outline of which is below. def makeOIP(): global objectHand , BackgrdColourDict, ForeGrdColDict, position_note_rec_name ok, objectName, objectHand, recordHand, wallHand = vs.GetCustomObjectInfo() theEvent, theEventData = vs.vsoGetEventInfo() # Gets Object Event info if theEvent == tb.Constants.kObjOnInitXProperties: # If the event is the initialisation of the object ok = vs.SetObjPropVS(tb.Constants.kObjXPropPreference, True) # Allows for creation of custom OIP ok = vs.SetObjPropVS(tb.Constants.kObjXPropHasUIOverride, True) # Custom OIP Overrides standard UI ok = vs.SetObjPropVS(tb.Constants.kObjXPropPreference,True) # Enables preferences menu for PIO ok = vs.SetObjPropVS(tb.Constants.kObjXHasCustomWidgetVisibilities,True) vs.vsoInsertAllParams() # Inserts all Parameters floato OIP result, scaleWidID = vs.vsoPrmName2WidgetID('','Scale') thisDoesNothing = 0 result = vs.vsoAppendWidget(tb.widgetTypes.WidgetButton, link_pos_button_id,'Get Position Info', thisDoesNothing) if theEvent == tb.Constants.kObjOnWidgetPrep: WidgetPrep() # Sets Info within the OIP if theEvent == tb.Constants.kObjXPropPreference: defaultVals = {} # Creates blank Dict for default vals MakePropertiesDialog() if theEvent == tb.Constants.kObjOnObjectUIButtonHit: # If the event is a button being pressed if theEventData == link_pos_button_id: # If the Button Pressed is Link Position Button link_to_hp() # Runs if theEvent == tb.Constants.kResetEventID: # If Object is reset init() # Creates the Object When the button is pressed it calls a function, link_to_hp() def link_to_hp(): vs.SetObjPropVS(tb.Constants.kObjXHasCustomWidgetVisibilities, False) # Sets widget custom visibility to false try: vs.GetPt(PickPointCallback) except Exception as e: vs.AlrtDialog(str(e)) h, p = 0,0 Fix_H = vs.Rpstr_GetValueStr(tb.ValueStrings.FixtureHandle_TempValString,False) # Stores the Fixture handle as a Vectorworks Value String vs.Message(str(Fix_H)) vs.SetObjPropVS(tb.Constants.kObjXHasCustomWidgetVisibilities, True) # Sets widget custom visibility to True def PickPointCallback(pt): vs.Message('X: ', pt[0], 'Y: ', pt[1]) Fix_H = vs.vstGetPickObject(pt[0],pt[1]) # Stores the fixture handle as a VWX Value string for retrieving later after GetPt callback has been run vs.Rpstr_SetValueStr(tb.ValueStrings.FixtureHandle_TempValString,Fix_H) vs.SetObjPropVS(tb.Constants.kObjXHasCustomWidgetVisibilities, True) # Sets the Custom Widget visibulites back to True The main issue I'm having is that whenever I press the button, the GetPt cross hairs appear, I'm able to select a point, but then Vectorworks crashes, with no error message. I understand the main issue is that the Python function GetPt will not block execution, so I need to use the callback function. However I am still getting the same results. From a fair amount of searching of the forums, I have found several suggested solutions such as @Paolo suggestion in this thread to disable custom widget visibilities whilst vs.GetPt is running, however sadly this does not seem to have any affect. I've seen suggestions that there cannot be any functions inbetween the GetPt call, purely as a test I've tried adding a vs.GetPt() at the end of the of the file, with some very dodgy logic to allow it only to run after the UIButton has been hit. E.g: makeOIP() if runGetPt: vs.GetPt(PickPointCallback) Still no improvement, still crashes with no error. I've tried completely emptying the PickPointCallback, in case it was something inside there, but still no change. Does anyone have any suggestions as to how to achieve this kind of functionality within a Python Script? Surely people have managed to find a way around this? @Vlado @JBenghiat @twk Thank you in advance!
  3. An script to find the object type number and name of the selected item, works also when placed in right mouse button menu. _hObject=vs.LSActLayer()#get handle of last selected object _tObject=vs.GetTypeN(_hObject)#get typeindex #_tObject=_hObject.type is also possible _list=["1","Line","Rectangle","Oval","Polygon","Arc","7","Freehand","3D Locus","Text","Group","12","Rounded rectangle","Bitmap Image","Symbol in document","Symbol definition","2D Locus","Worksheet","19","20","Polyline","PICT Image","23","Extrude","3D Polygon","26","27","28","Layer Link","30","Layer","32","33","Sweep ","35","36","37","Multiple extrude","39","Mesh","Mesh vertex","42","43","44","45","46","Record Definition (Format)","Record","Document script (1)","50","Script palette (1)","52","53","54","55","Worksheet container","57","58","59","60","61","62","Dimension","64","65","Hatch definition (1)","67","Wall","69","70","Column, Floor, Roof Face","72","73","74","75","76","77","78","79","80","Light","Roof edge","Roof object","CSG Solid (Addition,Subtraction)","85","Plug-in object","Roof element","88","Round walls","90","91","Symbol folder","Texture","Class definition (1)","Solid (Cone, Sphere, ...)","96","Texture Definition(Material)","98","99","100","101","102","103","104","105","106","107","108","109","110","NURBS Curve","112","NURBS Surface","114","115","116","117","118","Image Fill Definition (1)","Gradient Fill Definition (1)","Fill Space (1)","ViewPort"] vs.AlrtDialog('type no. :',_tObject,'\ntype name :',_list[_tObject-1]) # show type index and type name of selected object in an dialog
  4. Routinely I import (level 1) a py module (level 2) that, in turn, imports another module (level 3). I've been making changes for weeks to the level 3 module and those were reflected in VW until now. Suddenly VW2023 stopped to detect changes to the level 3 module; I tried to fix resetting script's paths with no success. The solution was to use the importlib module in the level 2 script to force the reloading of the level 3 module: import utilerias import importlib import utilerias importlib.reload(utilerias) Hope it helps.
  5. A new plugin object, Arches, is available from https://fitplot.it/vwplugins/opening_arches.html. It essentially creates arches openings from (so far) 33 starting models! Customisable on width and height as well as other parameters (as requested from the type of arch). Also arches openings can be decorated with stones / bricks or trims. A free demo is available for download (for VW2022 and VW2023). The demo is fully working (you can essay all the types!) but important parameters (width and height) are disabled. To get the unlimited version, you have to get the licence key (through Gumroad®). This is my first plugin that adopt a licence key mechanism (already experimented with my app FitPlot, available on the Mac App Store and at the same time through Gumroad®). Plugins for Vectorworks developed in Python can successfully implement the Gumroad® licence key's APIs. Maybe, I can start to release some of my plugins through the partener install page… @LDraminski For whom interested in the Python / Vectorworks® / Gumroad® key licensing algorithm I have adopted, please, contact me in DM.
  6. Hi Folks, I build a working marionette and exported it as python file (Rightclick on marionette node -> Save Marionette Script as Python Script -> Saved File on local drive). Then I made a new Python script and imported the File into it (in Script Editor -> Text File) Now I get this error message: I know, there is a way to implement the marionette as a menu command. But this is not what I want. I want the script to be included in the file. Can somebody help please? Thanks! Regards, Rob Inst Type Popup.vwx
  7. Hi all. I'm trying to link some text in a symbol to a field of a record format. I've double-triple checked that I have the names of the record format and field correct, but I don't end up with linked fields. I have over 100 fields to link, which is why I'm trying to automate this process. Here's a snippet of the script that's tripping me up: vs.BeginSym("Console Routing") # some other code # for chan in range(64): vs.CreateText(f'input {str(chan + 1)}') vs.LinkText(vs.LNewObj(), "ConsoleRoute", f'Input{chan + 1}') vs.EndSym()
  8. How to read (and write) in kUserDataNode from Python I have traversed all nodes, find type etc, read records but cannot find a function to read or write data in this type of nodes
  9. Hello, I was wondering if there was a good way to trigger a Python script in VW using AppleScript? There are some scripts that can be "installed"? if im not mistaken. Is it possible to have VW run that command when the AppleScript ask it too? I got a bit interested in this kind of workflow when Pat Standford mentioned it. If the answer is yes, then my follow up question would be: do I need to use an installation script ie. install.py to add the functionality? Thanks
  10. Hello people, I just edit because I found this way. import vs import os Vendor = 'ACME' Price = 123.45 Tax = 1.07 fileName = 'Classes.txt' def Example(): vs.GetFile(fileName) if not vs.DidCancel(): vs.Rewrite(Vendor, 0) #vs.WriteBin(Vendor) #vs.WriteMac(Vendor) #vs.WriteLnMAC(Vendor) #vs.Write(Vendor) vs.Close(fileName) Example() But, the next attributes get this message: "AttributeError: module 'vs' has no attribute 'WriteBin'. " -vs.Write -vs.WriteLnMac -vs.WriteBin -vs.WriteMac With write I don't get error, but also no result. -vs.Rewrite
  11. Hi all, I have some plugin objects that I would like to use predefined symbols instead of drawing their geometry for each instance, but I'm having a lot of trouble figuring out how to import a symbol from a user library. It looks like the functions under "Document List Handling" might hold the key, but I can't make any sense out of them. Is what I'm trying to do possible? What would a basic script for this look like? Thanks!
  12. Hi, Some years ago I wrote a few tools in Vectorscript based on a number stamp. The idea is simple enough: enter a starting number in a dialog, start clicking, the number increments and is "printed" in the drawing on each mouse click. In the actual implementation there is other stuff going on too, but it's just this part I need help with at the moment. The Vectorscript tools work fine, but now I would like to re-write them in Python, but I can't get it working at all! This is because I am probably too stupid to understand what I need to do, but also it is because of the way GetPt() seems to works in Python. Also I don't get how to use KeyDown() in Python. I am open to any suggestion on how to do this in python in any way it works: Enter a starting number in a dialog Start clicking to add numbers (as text) that increment with each mouse click. It seems like this should be simple enough, but I have been trying to get it to work for a while and i can't! Any help would be much appreciated. Here, below, is a simplified version of my Vectorscript that works fine, and below that one example of how I have tried (and failed miserably) to translate it to Python: { V4 Simple Number Stamp Tool By: Benedick Miller Date: 2014-10-06 } Procedure SimpleNumberStamp; VAR n,i,keyhit:INTEGER; pt:POINT; t:STRING; BEGIN n:=IntDialog('Enter the starting number','1'); IF NOT DidCancel THEN keyhit:=27; i:=1; DSelectAll; while not keydown(keyhit) do begin t:=num2Str(0,n); getpt(pt.x,pt.y); TextOrigin(pt.x,pt.y); CreateText(t); n:=n+i; redrawall; end; END; Run(SimpleNumberStamp); And the Python translation: # Print Incremental Numbers on each mouse click until [Esc] # NOT WORKING!!! import vs def label(pt): vs.TextOrigin(pt[0],pt[1]) vs.CreateText(str(n)) vs.ReDraw() def kdwn(): k=vs.KeyDown() return k[1] keyhit = 27 i = 1 n = 1 vs.DSelectAll() n = vs.IntDialog('Enter the starting number', n ) if not vs.DidCancel(): while not kdwn() == keyhit: vs.GetPt(label) n = n + i
  13. So I am attempting to encrypt some plug ins objects (a mix of .vso and vsm objects) to distribute to others. I've done some searching of this wonderful forum, aswell as reading the Vectorscript Guide section on encrytion. Following the instructions in this thread. I created a XML File named the same as my PIO, My code is directly inside the object so I don't need to include any extra files so my XML file just looks like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin> <Package> </Package> </Plugin> I've selected my plug in in the plug in manager, used the Ctrl+Shift+Alt and Double Click method, confirmed twice that I want to encrypt it. All seems to be successful, it won't let me edit the script anymore. However if I go look at the .vso file in a text editor I can still see all the code. Also if I copy the file out of my plug in folder, and then copy it back in, replacing the original, (To try and test installation process for another a new user) I can then edit the scripts again. Am I missing something super obvious? I've seen other people running into similar problems in other threads, but I haven't found any solutions anywhere.
  14. So I was doing some bug hunting within one of my plug ins, and I seem to be getting some unexpected results from the vs.FindFileInPluginFolder() function. I'm using the function to retrieve the filepath for a file within my plug ins folder, which works absolutely fine. Where I'm running into problems is when I'm trying to handle a situation where said file does NOT exist... Below is the test code i'm using: import vs ok,path = vs.FindFileInPluginFolder('FileName.ini') if ok: # If File Exists vs.AlrtDialog("ok") else: # If File Does NOT Exist vs.AlrtDialog("no") The problem I seem to be running into is that the ok Boolean keeps returning True even when the file is definitely not present within the Plug Ins folder. First I thought it was still just cached in VW memory somewhere, so tried the old restarting VW trick. Same result. Eventually I noticed that I had another File called "FileName.vso" in the plug ins folder. a bit of experimentation later yielded these results: When FileName.ini is NOT present within Plug Ins Folder, but FileName.vso IS present: FindFileInPluginFolder('FileName.ini') Returns True FindFileInPluginFolder('RandomName.ini') Returns False FindFileInPluginFolder('FileName.randomfileextension') Returns True So from this it would suggest to me that FindFilePluginFolder command ignores file extensions and just looks for the File Name. Is this working as intended? The Function reference does say it searches for File Name, but then the example further down has an extension attached to it, and I believe it's fairly common practice within most filename/path related programming functions to take the extension into account? If this is working as intended does anyone have a nice workaround for dealing with same file names but different extensions. I was thinking I could probably do something with vs.GetFolderPath(-2) and some os.path commands... I realize the simplest solution is just to make sure every file has a unique name, which is probably what i'll end up doing, but thought i'd see if anyone has any helpful insights before I go digging through all my code for every reference to this particular file...
  15. I'm trying to write a script that will allow me to generate an array of LED tiles with custom symbols. I'm looking through the reference documentation, I can not seem to find a way to prompt the user to select a symbol. Much like when you click "replace" you get the small selection window that asks you to select the symbol. Is there a function that will return the chosen symbol into a custom variable?
  16. Hi All Apologies if this has been covered somewhere else, though I'm struggling to find any similar topics, could just be i'm not using the right terminology. I'm trying to recreate the functionality similar to that of Spotlight Hanging Positions and their ability to automatically assign Positions to Fixtures that overlap with the HP. e.g: I want to have a "base" PIO and when I insert a different PIO (Say PIO 2) into the drawing, PIO 2 calculates if it overlaps with any "Base" PIO's and if so queries said "Base" object and retrieves some information from it. The bit I'm struggling with is how to go about working out what objects overlap with said PIO 2. I suppose I could get PIO 2's bounding box co ords and then somehow query if there are any other objects within those same Coordinates. But I though I'd ask if anyone has any better ideas before I go down this route? Thanks In advance!
  17. vs.GetLBHeaderTextWidth(className, allowForSortIcon) The function above is crashing my VW 2021. Anyone else can confirm before I try a reinstall/bug submission? It gets pixel width for specified string (param:className for some reason??) for use with Dialog ListBrowsers.. Cheers, Tui
  18. I'm using vectorscript/python to make an list of all objects with an certain record and using information from this record. to eliminate human errors I'm starting the script with making the record so I'm certain all names and fields are correctly named. The thing that i can not get working at the moment is making an field in the record with an option module. so an field where you can not type but you have to choose between predefined options. does someone know if this is possible to create? when you make an record yourself in VW this is possible so why not with scripting
  19. I know this has been discussed in several threads before, but after extensive reading and experimenting I'm still clearly missing something. I'm trying to get the handle for a user selected object within an event enabled Plug in Tool. e.g User clicks button in OIP -> Highlight mode is turned on and user clicks on desired object -> Handle is returned and code continues onwards. I've created the event enabled object, and added the button to the OIP fine, and used TrackObjectN() to allow highlighting of only relevant objects. The issue I'm running into is actually getting the handle of the object. I understand that TrackObjectN is only highlighting, and not a selection mode, but from my reading of the wiki for TrackObjectN: def vs.TrackObjectN(traverseType, callback): return (outObj, p) It should return the handle and Co Ords whenever the user mouses over or clicks an object that relates to the criteria. e.g if the last action is a click on the desired object it should return that handle, or atleast it's co ordinates from which I could then use PickObject to get the handle. In reality when I try: outObj , p = vs.TrackObjectN(0, trackObjCallback) It throws a TypeError 'NoneType' object is not iterable. Given that when I try: vs.TrackObjectN(0,trackObjCallback) It functions as expected, but without returning any handle or co ordinates i'm guessing either i'm using this wrong or it doesn't actually return such information. I'm wondering if I need to try using vstGetEventInfo to look for a mouse button click and then capture the mouse's current Co Ordinates, however after searching "MiniCadHookIntf.h" I couldn't obviously see any obvious constant for a mouse click. TL/DR I'm trying to capture a handle for a user selected object, within a event enabled object and have clearly missed a step somewhere! Any help or nudges in the right direction would be greatly appreciated! Relevant parts of current code pasted below: import vs def makeOIP(): link_pos_button_id = 1234 # User Button Id theEvent, theEventData = vs.vsoGetEventInfo() # Gets Object Event info if theEvent == tb.Constants.kObjOnInitXProperties: # If the event is the initialisation of the object ok = vs.SetObjPropVS(tb.Constants.kObjXPropPreference, True) # Allows for creation of custom OIP?????? ok = vs.SetObjPropVS(tb.Constants.kObjXPropHasUIOverride, True) # Custom OIP Overrides standard UI vs.vsoInsertAllParams() # Inserts all Parameters into OIP displayString = "Link to HP" # text for button result = vs.vsoAppendWidget(tb.Constants.kWidgetButton,link_pos_button_id,displayString,doesNothing()) # Add Button to OIP if theEvent == tb.Constants.kObjOnObjectUIButtonHit: # If the event is a button being pressed if theEventData == link_pos_button_id: link_to_hp() # Function to run to allow user to select object. if theEvent == tb.Constants.kResetEventID: # If Object is reset # Code to run on object reset def doesNothing(): pass def trackObjCallback(h,x,y): HPHandle = vs.PickObject((x,y)) if vs.GetTypeN(h) == 86: return True def link_to_hp(): vs.TrackObjectN(0, trackObjCallback) outAction, outMessage1, outMessage2 = vs.vstGetEventInfo() #vs.Message(str(outObj)) makeOIP()
  20. I'm writing an script that will take each symbol(_i in list of symbols) from the resource folder makes an render and places it in an folder. for _i in _lSymbols: _Renderlayer=vs.Layer('Render') _hRenderlayer=vs.ActLayer() vs.Symbol(_i,0,0,0) vs.DoMenuTextByName('Standard Views',8) vs.DoMenuTextByName('Fit To Objects', 0) vs.SetLayerRenderMode(_hRenderlayer, 6, True, True) vs.DoMenuTextByName('Copy',0) vs.DeleteObjs() vs.DoMenuTextByName('Paste As Picture',0) _hImage=vs.LNewObj() _iRenderFolder=_RenderFolder+ '\\' +_i+'.png' vs.ExportImageFile(_hImage,_iRenderFolder) vs.DeleteObjs() One problem i encountered is that when i set the render mode as "Final Quality Renderworks" (14) or "openGL" (11) it will produce an white square with "paste as picture". so whit this script I'm limited to using modes as "FinalHiddenLine"(6) Also my "vs.ExportImageFile" is not working at the moment. Can Anyone give some tip ore advise on this script or how the get an similar result using other functions. I also looked into using vs.DoMenuTextByName('Export Image File') but this wil give an dialog for the user and I'm trying to limit/eliminate all user interaction. See also my other topic on an small part of this script
  21. I'm writing an Python script with this part in it: vs.DoMenuTextByName('Standard Views',8) vs.DoMenuTextByName('Fit To Objects', 0) vs.SetLayerRenderMode(_hRenderlayer, 6, True, True) Now i have the problem that the script gives the order to set the view and zoom and VectorWorks will do this , but when the script is ordering to set the rendermode VW is still busy setting the zoom and view and will skip this step. If i run this script again without changing my zoom and view it will set the render mode correct because then VW can skip zoom and view and is ready when it gets the order to change the rendermode. I Think the issue is probably that VW is visually showing the zoom an view change and that takes time. To set the rendermode first is not working because it will change back to wireframe when the zoom/view is changed. I also tried the function vs.Wait() but this is not making any difference except the script takes longer to run. Has someone an idea to overcome this?
  22. Hi All Apologies if I've missed something glaringly obvious (I've searched the forums and can't seem to find an answer) i'm wanting to create a dialog where the user can still interact with the OIP and the rest of VW whilst said dialog is open and running. Effectively I want a dialog window that is open and on top, but still allows users to interact with the rest of VW. I'm wondering if I might be able to accomplish this with SetLayoutOption() however for the life of me, I can't find a list of options and values I can pass to this command. Is there a convenient list of said options somewhere? Or can anyone suggest another way to accomplish this?
  23. 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
  24. I'm currently working on a couple of plug ins that need to interact with Spotlight Hanging Positions. The first thing i'm trying to do is get the total length of a hanging position. Thanks to some excellent topics and replies from @Sam Jones and @JBenghiat I've got my head around accessing the objects within the hanging position group, and the different kinds of objects I may expect to find within, and iterating through the objects to get the total length. My question is: For HP's containing Truss PIOs is it better practice to use the TrussItem parametric record or the Truss Record for getting the length? From what I can gather the TrussItem Length field is affected by the units of the active documents units, whereas Truss Record appears to always be in metric mm. I think using the Truss Record probably makes more sense as then I have a consistent set of units and don't need to worry about logic to work out the units of measurement. I just wanted to try and get some confirmation if my thinking was in fact true or if i've missed something. Secondly for HP made up of individual symbols (so no truss record) is there a way to get either the symbols total length or the even more directly the HPs total length? For bonus points are there any good resources floating around that deal with the inner mechanics of Spotlight? Pretty much everything I've managed to do with spotlight so far has had to be learnt through trail and error! Thank you in advance
  25. Wondering if anyone can advise on this - I'm having some trouble with control point precision that is leading to erroneous behavior in a plugin object. I detected this issue in part through the debugger. Basically, when I drag a control point, it seems that the values I get when I access its coordinates from inside the scripting environment are truncated to only 6 decimal places. This introduces error into calculations based on that value. I have tested further by creating an object to use as a snapping location, and setting the position of this object to coordinates that require more than 6 decimal places to represent. If I increase the decimal place precision in the document unit preferences, I can see all of these decimal places in the OIP for the reference object. If I drag a control point in my plugin object to snap to this reference object, and then, by setting a breakpoint, inspect the value I get inside my script by accessing the control point (with, for example, vs.PControlPoint01Y), I see the value is still truncated, regardless of the document unit / precision settings. At only 6 decimal places, this can introduce pretty significant error. Is there some obvious thing I am missing to correct this behavior? I would expect that when I snap a control point to a location, the control point would be assigned a value as accurate as possible, or at least as accurate as the document settings indicate. Not sure if this is specific to Python scripting or not.
×
×
  • Create New...