Jump to content

PatW

Member
  • Posts

    78
  • Joined

Reputation

29 Great

1 Follower

Personal Information

  • Location
    Germany

Recent Profile Visitors

1,948 profile views
  1. In the SDK you would use the class IExtensionWebPalette to define your webpalette and IWebJavaScriptProvider to register the JavaScript functions which can hand data back to the C++ part. class YourCustom_JSProvider: public VCOMImmediateImpl<IWebJavaScriptProvider> { public: CableToolWebPaletteJSProvider(); virtual ~CableToolWebPaletteJSProvider(); virtual void OnInit(IInitContext* context); virtual void VCOM_CALLTYPE OnFunction(const TXString& name, const std::vector<VWVariant>& args, VectorWorks::UI::IJSFunctionCallbackContext* context); private: IWebPaletteFrame* fWebFrame; }; // -------------------------------------------------------------------------------------------------------- class YourCustom_JSProviderCableToolWebPalette : public VCOMImmediateImpl<IExtensionWebPalette> { DEFINE_VWPaletteExtension; DEFINE_VWProtection; public: CableToolWebPalette(CallBackPtr); virtual ~CableToolWebPalette(); virtual IEventSink* VCOM_CALLTYPE QueryEventSink(const TSinkIID& iid); virtual TXString VCOM_CALLTYPE GetTitle(); virtual bool VCOM_CALLTYPE GetInitialSize(ViewCoord& outCX, ViewCoord& outCY); virtual TXString VCOM_CALLTYPE GetInitialURL(); private: CableToolWebPaletteJSProvider fJSProvider; }; Register the function: void YourCustom_JSProvider::OnInit(IInitContext* context) context->AddFunction( "VW_UpdateData" ); When it is triggered in the webpalette this callback is executed: void YourCustom_JSProvider::OnFunction(const TXString& name, const std::vector<VWVariant>& args, VectorWorks::UI::IJSFunctionCallbackContext* context) Unfortunately there is no doc about this on the vw wiki.
  2. Here is a solution that works with a list that has na even amount of members. For uneven lists you could addd another placeholder value and remove it from the final list again. zipList_v2020.vwx
  3. There is a auto compensation if you exceed the maximum chainlength of the hoist. A possible workaround is to change the chainlength( = maxchainlength) recordfield in the hoists symboldefinition then you need to replace the symbol of the hoist by the same in order trigger a refresh of the chainlength.
  4. You are right from a user view it makes more sense when the error appears for the first line. But in Python a statement can go to the next line when it is within brackets. So the python engine realizes that something is wrong when it suddenly sees a declaration in the next line. This is valid for example: print ( "a" + "b")
  5. def callback(h): sym = vs.GetRField(h, "BrxHoist", "SymbolUsed") symH = vs.GetObject(sym) if symH: val = vs.GetRField(symH, "HoistObjectData", "Manufacturer") vs.SetRecord(h,"HoistObjectData") vs.SetRField( h, "HoistObjectData", "Manufacturer", val) vs.ForEachObject(callback, "(R IN ['BrxHoist'])") Here is a little scrip which I quickly put together. It attaches the record to each hoist and only fills in the manufactur. Could be done better but I hope this works for you.
  6. Within VectorWorks\VW28.0.2b(671358)_64\Plug-Ins\Marionette.vwr\Scripts\ (vwr is a zip archive) you can find the Marionette.py Put this one in the pycharm project and then use import Marionette in the script, then all the errors should dissappear. The same applies for the vs.py that you can find at the end of this page. Search for "IDE and Debugging Python Scripts" https://developer.vectorworks.net/index.php/Python Another trick to make development easier is to add the path of your custom node py to the script option (Tools->PlugIns->Scipt options..) and then import the py module into the actial marionette node instead of copying it everytime from the IDE.
  7. I also see no other way than RunTemp tool. You pass in the IID like this: gSDK->RunTempTool( Your_VWExtensionToolClass::_GetIID()); You could write the data of the tool into a static class member that you acces then from the menu command or which is saver you finsih the job in the ::PointAdded method of the VWExtensionTool.
  8. Hi, when editing vwstring files Git shows the message "no changes found" in the diff view, I know this has to do with the utf-16 encoding but all the solutions of stack overflow didnt help so far. Did anyone here figure out how to fix this? regards, Patrick
  9. With the new hoist you can use the "Select Symbol" Button in the OIP. If these hoists are legacy vectorscript Hoists they can be upgraded with the command: Tools->Utility->Convert Old hoists. regards, Patrick
  10. I think the conversion is not correct, try it with: rgb16bit = rgb8Value * 257; 255 * 257 = 65.535
  11. What you could try is to put it temporaly in a folder before exporting and see if ExportResourceN maintaince the structure. Another solution I can think of is opening the lib file and create the folder. Unfortunately this can not be done silently so the user will see the file poping up for a second. if ( gSDK->OpenDocumentPath( fileID, true)) { // DoStuff gSDK->DoMenuName("Save", 0); gSDK->CloseDocument(); gSDK->HandlePendingUpdatesAndActivates(); //workaround for bug in OnFileContent: to trigger closedocument }
  12. Do you usualy copy the whole content out of the symbol, then maybe "Modify->Convert to Group" is what you need.
  13. In the list of the linked post I could find "Purge Items", maybe that works for you.
  14. Just stumbled over the vs-py rosetta stone, in case you dont already know it: https://developer.vectorworks.net/index.php/User:CBM-c-/VS-Py_Rosetta_Stone
  15. The trouble is caused by the special character in node "Info/Bemerkung" remove the "/". The error message was hard to understand.
×
×
  • Create New...