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

  • In-Person Training - US
  • In-Person Training - UK
  • Coffee Breaks
  • Essentials Seminars
  • 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. Hey All, So, I don't know if anyone has done a lot of drawing of text through python, but I think I've either found a bug or am completely misunderstanding how to vs.TextSize works. I realize that text size changes relative to Layer Scale. In my script have defined a scale factor to take this into account. The problem that I seem to be running into, is that when the drawing is set to Millimeters for units, the smallest that I get the vs.TextSize function to draw is 1. When I set the font size to less than 1, the text doesn't draw at all. Now if I just drop a text object into the drawing, I can seemingly set the Font Size down to at least 0.01 Point via the OIP pulldown. I may be wrong, but it appears as if the vs.TextSize function, even though it says it accepts non-integer values, appears as if it is applying a rounding function to the input before passing it to the actual drawing routine within VW. Has anyone encountered this before or am I just overlooking something that is completely obvious? Cheers, -gonda
  2. Hey All, So, I'm working on implementing a Custom Object in python that I want to have Events enabled for. I understand the I need to use vsoGetEventInfo function to get the Event ID and any related info (Control ID, Button ID, etc)...my question is, if there a list somewhere of all of the possible Event ID Integers and descriptions of what each of them are? I've tried looking through the dev documentation and I've found a few scattered here and there in various examples but I have been unable to find a comprehensive list. Does anyone either know where one of these is or has a list that they can post? Cheers, -gonda
  3. def rename(h): vs.AlrtDialog(h) return () vs.ForEachObject(rename, "((L='Layer') & (SEL=TRUE))") Hi, sorry in advance if I'm not using the correct terms. I'm new to Vectorworks and I want to write a script which get the properties of selected objects. At the moment I have a Handle object which does show me the attributes of the selected object. I want to use the data to populate other objects in the same layer.
  4. I created a plugin object using python. The main code was pasted into the script editor via the plugin manager. I compiled the script and the plugin item works as it should. Now I would like to lock the script. I'm on a mac and recently made the jump from Vectorworks 2008 to 2016. In the past when creating a vector script I could lock it by holding down 'command' + 'option' + 'shift' + 'caps lock' (it was important that all external files had the extension .px) Now i'm in 2016 and scripting with Python. I only have 1 other file in addition to "import vs", which is, "import shapes" when i compile my script (shapes.py). It finds this file via the scripts options/environment paths. How do I go about locking or encrypting this plugin object? also, I do have a __init__.py file included in the folder that contains shapes.py
  5. Greetings all, I'm trying to wrap my head around, showing an image in dialogue. I see this function call: def vs.CreateImageControl2(dialogID, controlID, widthInPixels, heightInPixels, imageSpecifier): return None ..but can't get it to work. The issue is with the 'imageSpecifier' parameter. Looking at other posts, https://forum.vectorworks.net/index.php?/topic/41757-2014-script-will-not-run-in-2015/&do=findComment&comment=209508 @klinzey instructed the use of a folder named _some_name.vwr, with your image in there, and use that path for the imageSpecifier. However, what if you want your image structured down the folder channel the same way your plugins are structured. Eg AppData |-- Roaming |---- Nemetscheck |------ Vectorworks |-------- 2016 |---------- Plugins |------------ TuiPlugins |-------------- PluginImages |----------------| rectange.png |-------------- Rectangle.vso full_image_path = "TuiPlugins\PluginImages\rectangle.png" def CreateDialog(): -- vs.CreateResizableLayout(etc,etc..) -- vs.CreatePullDownMenu(etc,etc..) -- vs.CreateEditText(etc,etc..) -- vs.CreateImageControl2(dialog, k_image , 200, 200, "{}".format(full_image_path)) can this be done? Or does the folder have to have the .vwr characters appended to it? And can the location of this *.vwr folder be placed further down? Hope this makes sense
  6. Could you please add python syntax-highlighting for posting code to the forum. Thanks
  7. I've been trying to get data from a worksheet by Python script. Here is the basic code: def FindTable(): hLayer = vs.GetParent( vs.FObject() ) vs.EnableDrawingWorksheetPalette(True, None) while hLayer != None: h = vs.FInLayer( hLayer ) while h != None: # worksheet? if vs.GetTypeN(h) == 56: rows, cols = vs.GetWSRowColumnCount(h) cellnum = vs.GetCellStr(h,1,1) vs.AlrtDialog( vs.Concat('Cell 1 ',cellnum,' Name: ',vs.GetName(h),' visible: ',vs.AreWorksheetGridLinesVisible(h),' rows=', rows, ' cols=', cols) ) h = vs.NextObj( h ) hLayer = vs.NextLayer( hLayer ) return 0 It doesn't work and returns 0 rows and columns. I guess "Worksheet container" type is not good and these APIs don't work but the cycle returns only handle with type 56 even without any 'if' condition. Maybe "Worksheet" type is what I'm looking for? types and IDs But how can I obtain it?
  8. Hi, I need some help with custom plug-ins. I created a custom plug-in with a custom point object. It seems to work fine Now I need to create a command that will be executed from a menu that invokes the tool to place the custom point object in the document. I've been looking around but I don't seem to find how to do it. My questions are How to invoke the tool for the custom point object from the command script How to set up the parameters for the custom tool (Height, Width, etc.) for the new object I'm about to create Thanks in advance.
  9. I would like to be able to export to pdf from a script without having to prompt the user to choose pdf settings and a location or filename for the files. Currently the only way to do it is to call these functions like this: vs.AcquireExportPDFSettingsAndLocation() vs.OpenPDFDocument(inFilenameStr) vs.ExportPDFPages(savedViewNameStr) vs.ClosePDFDocument() Could we we have an alternative to the first function like this: vs.SetExportPDFSettingsAndLocation( location, dpi, blah, blah, etc)
  10. Having trouble getting vectorscript functions that require a vector as parameter to work properly. In the snippet of code below, I think that ang should equal 45°. But the dialog tells me -90° and then I get the error shown in the attached file: pt= [1,1] ang = vs.Vec2Ang(pt) vs.AlrtDialog(ang)
  11. https://forum.vectorworks.net/index.php?/topic/44990-syntaxerror-eol-while-scanning-literal/ Apparently it's a Vectorworks Python API bug. Can we please have this fixed, as after this error occurs you cant get rid of the error until you restart Vectorworks
×
×
  • Create New...