Jump to content

Search the Community

Showing results for tags 'pio'.

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

Found 14 results

  1. 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!
  2. I've got an event-enabled linear PIO that raise a custom dialog with a double click on it. It works fine swapping values between custom dialog and info object palette. I've implemented dialog handle procedure with item 1 (OK Button), item 2 (CancelButton). Now I would like to add item 12605 (preview button) which would operate as the Ok button (updating PIO ), but without exit from dialog. It doesn't work at all because seems that you must exit from the dialog event loop to obtain PIO updating. Thanks in advance for any suggestion.
  3. Hi I am wondering if anyone can advise - I have enabled the reset on move and reset on rotate flags in my PIO, and the handling of these events seems to work correctly when a single PIO is selected. However, if I select other objects along with the PIO, there are some issues. If the other objects are simple objects like rectangles, etc, their 'preview shadows' move as expected while the operation is in progress, but they do not redraw correctly after the move or rotate operation is completed. The other object appears to remain drawn in its old location. But if I move my mouse around, I can find that the object did in fact move / rotate correctly but is now invisible except to selection highlighting. If I select it and change an attribute, the drawing correctly refreshes. The incorrect 'old' object disappears. If I have multiple instances of my PIO selected, and perform a move or rotate, one of them behaves correctly. The others mostly behave correctly, but appear grayed. If I select them and change an attribute or otherwise force a reset, they return to normal. In addition, I sometimes observe drawing objects that were not part of the selection becoming grayed when I perform these operations. Is there something I am doing wrong or a step I need to add?
  4. Can you put symbols or PIO's in just one (or specified) components of a wall? e.g. in the attached image, I'd like to insert a column into the CMU blockwork component in the middle of the wall - like column 'C' which is not actually inserted, but 'on top' of the wall in 2D. The only insert options I find are in the Object Info palette : 'Centre line' (column A) and 'Left edge' or 'Right Edge' (Column B), both of which are inserted / offset relative to the entire wall, and not the preferred wall component, and create a hole in all the wall components... Am I missing something? Thanks, hope all are keeping well in these strange times, and best wishes to you and your families. S
  5. Hi, sorry, but I cannot find out how to write my marionette object's parameters into database records (or worksheet cells), which was my reason to create them – can someone point me in the right direction? I wasn't able to find example scripts ... My objective is to create a door schedule that uses simple, 2D, self-made, non-IFC door symbols with data stamps, to be placed on 2D-drawings (draftsperson does not use walls, just lines). Most parameters will be strictly database records that never appear on the drawing, but WIDTH, WALL THICKNESS, and OPENING DIRECTION (L/R) should be 'hard-wired', i.e. taken from the plan, in order to avoid common mistakes. My first approach was to calculate opening WIDTH and wall thickness from the bounding box of the door symbol/group. This works fine, but only as long as the wall layout is strictly cartesian and the doors are not rotated or mirrored. Also, we would like to use door symbols that are larger than the opening width (including frames etc.), so we would no longer be able to calculate the width from the bounding box, wich seems to be all a worksheet can access. Or is there a way to access data from objects INSIDE a group that is listed on a worksheet? So I created a marionette object that draws the door opening based on parameters, because I expected it would be easy to access those parameters from a worksheet or to write them to an attached database record ... but I find that task surprisingly difficult. Am I missing something? So far, my marionette network, run as a wrapper, can draw a door based on two parameters OPENING WIDTH and WALL THICKNESS, and attempts to attach a pre-defined database record to that object, where it correctly fills the fields for wall thickness and opening width. However, the result is a simple group (not a PIO, so it cannot be manipulated by parameter later), and it is nested twice in otherwise empty groups, unnecessarily. If I convert the wrapper into an object node, it becomes the expected parametric plug-in-object that I can modify later, but it does not attach a database record to itself or writes its data to a record that I attach manually. What am I doing wrong? test door database.vwx this is what the door symbol plus tags should look like this is my marionette object node (so far, without tags, but okay ... if it only wrote to the database !!!
  6. Here's what I'm trying to do: User selects an object User then selects the PIO tool and inserts the PIO PIO uses info from the selected object as a parameter value. Currently: I get the handle to the user selected object using LSActLayer or FSActLayer. Use GetRField to extract the information from the object. Run GetCustomObjectInfo to get the PIO handle Write the information to the PIO using SetRField The problem I'm having is that it appears that a PIO resets(vsoGetEventInfo #3) itself 3 times before the creation is finished. On the first reset event the handle still points at the user selected object, on the second reset event the handle is empty, on the third reset the handle points to the new PIO. Short of writing the information to a file how do I get the information from a user selected object into a PIO on creation?
  7. How come if I use the the "AutoHybrid" I lose all ability to use the PIO data? Catch-22 - Can't make an AutoHyrbrid of a Symbol and keep the data - Can't make an AutoHybrid of a Group to make a symbol with data am I missing something?
  8. So I found a cute Compass I want to use for a North Arrow. I use the North Arrow tool and see 10 "Configs" I see the "North Arrow" file in the Resources Browser. I Edit that file and see 27 existing arrows - now 28 with my new one. How do I change the "Configs" to use one of the other 27 arrows? Thanks 🙂
  9. I know to get and reset the value of a PIO parameter instance using GetRField and SetRField but what is the route to rebuilding the "choices list" of a particular parameter field? I don't suppose it is unique to the PIO instance but probably a global to the PIO definition. Would GetObject and SetObjectVariableString be the route? There is no SetPluginChoice or SetCustomObjectChoice is there? Or do I just need a handle to the PIO definition and use SetRField? And is this separator for the entries in the choices list or is it indexed somehow? &div& Larry
  10. Hi, wondering if anyone has encountered this or knows of a solution: When I enable custom object info palette for a plugin object with vs.SetObjPropVS( vs.kObjXPropHasUIOverride, True ) #8 I find that trying to change the value of radio buttons in the object info palette crashes vectorworks. I have inserted all of the widgets with vs.vsoInsertAllParams() I'm not trying to do anything crazy; I am really just trying to get some separators onto the OIP. I am handling Event 41 as guided by the wiki: ... elif theEvent == vs.kObjOnWidgetPrep: #41 UpdateParametersState() ... def UpdateParametersState(): vs.vsoSetEventResult( vs.kObjectEventHandled ) #-8 Changing the value of other parameters in the OIP, including numeric fields and checkboxes, works fine. Most importantly, I see the same behavior when I try the example plugin provided at http://developer.vectorworks.net/index.php/Python_Sample_Point_Object_(complex) If I click the radio button for Male / Female in this PIO's info palette, vectorworks crashes. This leads me to think there is more going on than bad code in my own object. I am running VW2017 SP4 on Mac OS X El Capitan
  11. Hi, wondering if anyone has any advice -- Sorry for the cross post; I was in the wrong topic area before. I have a plugin that includes a control point that is draggable, but which also exposes one of its coordinate input fields in the OIP to allow the user to type a precise value. When the user origin has been dragged, typed values in this field get offset in ways that lead to "incorrect" values, but dragging the control point behaves as if the current User Origin is the Internal Origin. I imagine I could use GetOrigin() to find the offset and fix this behavior, but how do I detect whether the parameter changed from a drag operation (in which case I should leave it alone) or a typed value in the OIP (in which case I need to fix it)? Or is there a way to get Control Points to only look at the user origin? (the documentation on plugin parameters would suggest not) thanks
  12. Hi all, I am creating a Linear plug-in object, and trying to catch and respond to the event where a user changes the LineLength by moving one of the two built in control points of the object. However, I cannot seem to figure out what event / state change this qualifies as. The vso states I know of are: vs.kCreatedReset = 0 vs.kMovedReset = 1 vs.kRotatedReset = 2 vs.kParameterChangedReset = 3 vs.kObjectChangedReset = 4 vs.kLayerChangedReset = 5 vs.kExitFromEditGroup = 6 vs.kObjectNameChanged = 7 Below is an example of some code I have used to try to detect this state change. Alerts appear as expected for move, rotate, attribute change, and parameters changed either in the OIP or by moving an added Conrol Point parameter in the drawing, but when I drag the two points that are actually built in to the PIO, although I do receive 3 for the event, triggering the ResetEventHandler in this case, no alert fires off for any of the checked state changes. It seems that this state change is not one of those listed above. I expected it to be a Param change along with possibly a rotation and position change, depending on which of the two points was dragged. Can anyone advise on what state I need to check for, and how I can capture the new and old value for line length, rotation, and position that could have been adjusted by this action? def execute(): global objname, oh result, objname, oh, rh, wh = vs.GetCustomObjectInfo() theEvent, message = None, None theEvent, message = vs.vsoGetEventInfo() if theEvent == vs.kObjOnInitXProperties: #5 #enable eventing for this plug-in vs.SetPrefInt( vs.kParametricEnableStateEventing, 1 ) #590 result = vs.SetObjPropVS(vs.kObjXPropAcceptStates, True) #18 elif theEvent == vs.kObjOnAddState: #44 message = vs.vsoStateAddCurrent( oh, message ) elif theEvent == vs.kParametricRecalculate: #3 ResetEventHandler() def ResetEventHandler(): global objname, oh if vs.vsoStateGet( oh, vs.kCreatedReset ): vs.AlrtDialog("Object Just Created") if vs.vsoStateGet( oh, vs.kMovedReset ): vs.AlrtDialog("Object Just Moved") if vs.vsoStateGet( oh, vs.kRotatedReset ): vs.AlrtDialog("Object Just Rotated") if vs.vsoStateGet( oh, vs.kParameterChangedReset ): vs.AlrtDialog("Parameter Changed") if vs.vsoStateGet( oh, vs.kObjectChangedReset ): vs.AlrtDialog("Object Changed")
  13. 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
  14. Is it possible for a PIO to receive an event when a user switches to a layer containing the PIO? Thanks Will
×
×
  • Create New...