
Maarten DE
Distributor-
Content Count
9 -
Joined
-
Last visited
-
Thanks again 🙂 . I did notice that in IProviderCursorHandles, all the OnCursorAction_ ... and OnCustomBarEvent functions only get hit when clicking/hovering/... over parameter control points, not the dynamic created control points. Strangely enough, the GetHandle... functions of that class do get hit when clicking/hovering/... over dynamic created control points. Has anyone notice the same thing?
-
Thanks Wouter, the creation of the control points works now. A question: is it possible to have a custom data bar while dragging a custom control point? I tried this in a overwrite of VWParametric_EventSink::OnCursorEvent( ParametricMessage* message ), case message->fAction = ParametricCursorMessage::EAction::kAction_MouseDown: CustomBarRefID outCustomBarRefID; bool b = false; b = gSDK->CustomBarCreate( 1, outCustomBarRefID ); b = gSDK->CustomBarInstall( outCustomBarRefID ); CustomBarFieldInfo fieldInfo; fieldInfo.fFieldLabel = "Length"; fieldInfo.fFieldValue = 1000; fieldInfo.fIsEditable = true; fieldInfo.fIsLocked = false; b = gSDK->CustomBarSetFieldInfo( outCustomBarRefID, 0, fieldInfo ); // b = gSDK->CustomBarRelease( outCustomBarRefID ); It still shows the default data bar but all values are empty. When I don't use gSDK->CustomBarRelease() (because it returns false) the data bar values are still empty, except the first (X) has a reversed S in it... I tried the same in and overwrite of IProviderCursorHandles::OnCursorAction_MouseDown( ICursorHandleActionContext* context ) but that one doesn't even get hit (even when I remove the overwrite of VWParametric_EventSink::OnCursorEvent( ParametricMessage* message )). This doesn't work either. TXString lab = "Length"; gSDK->SetDataDisplayBarField( 0, barLength, lab ); gSDK->SetDimUserBarValue( 0, 1000 ); In the VWTool_EventSink class, I found these functions, but I don't think I should use them because the Control Points are part of the object, not the tool. Also, when I implement them, they don't get hit. virtual void OnCustomBar_Setup(); virtual void OnCustomBar_Setdown(); virtual void OnCustomBar_UpdateValues(); virtual void OnCustomBar_LockValue(size_t fieldIndex, const TXString& userString); virtual void OnCustomBar_UnlockValue(size_t fieldIndex); virtual void OnCustomBar_LockValue(const CustomBarLockValueData& lockData); virtual void OnCustomBar_UnlockValue(const CustomBarLockValueData& lockData); Did anyone got this to work in their PIO?
-
Hi all Is anyone able to create Control Points on the fly? On this page (and also in the SDK manual) it's explained but I think this is some old code because I can't find any case of that switch (action) in the SDK.
-
I'm using gSDK->AddObjectToContainer() now and it seems to work fine. But I'll keep that InsertBefore/InsertAfter in mind whenever something strange pops up on the way, thanks for the tip! And you're right about the nullptr, the function will already create a new instance. I've been out of the whole computer/programming/Vectorworks world for several years so it's all a bit rusty, but it's slowly coming back 🙂 .
-
Hooray, that did the trick indeed 😄 . I got thrown off because in check 5, I did get the container info (the layer) so I assumed I didn't had to add it another time... Never a boring day with the SDK 🙂 . Thanks for the help!
-
I forget to mention, I tried the same with the gSDK->... functions too, same result, no symbol instance in the drawing.
-
Hi all I want to create a symbol definition and place an instance of it in the drawing (active layer). I'm probably missing the obvious here, but why doesn't this work: // 1. Create the symbol definition, add a line to it. TXString symName = "a unique symbol name"; VWSymbolDefObj symDef = gSDK->CreateSymbolDefinition(symName); symDef.AddObject(gSDK->CreateLine(WorldPt(0, 0), WorldPt(100, 100))); // 2. Reset to make the line visible in the symbol definition. symDef.ResetObject(); // 3. Refresh Res Browser to make symbol def visible. gSDK->RefreshResourceBrowserResourcesList(true); // 4. Place this symbol on the active layer (reset all just to be sure) VWSymbolObj symInst(symDef, WorldPt(0,0), 0); symInst.ResetObject(); symInst.SetVisible(true); symInst.ResetObjectsVisibility(); // 5. as a check: get the name of the layer the object is placed on. MCObjectHandle* pOutContainerHandle = new MCObjectHandle; short* pOutContainerType = new short; double* pOutContainerScale = new double; symInst.GetContainerInfo(pOutContainerHandle, pOutContainerType, pOutContainerScale); VWLayerObj lay(*pOutContainerHandle); TXString layName = lay.GetName(); // The name of the layer is correct, but the symbol is not visible/selectable on the active layer. Step 1, 2, 3 works fine, the symbol definition is created and visible in the Resource Browser. I can manually drag and drop it in the drawing. Step 4 and 5 seems to work too, I get the container info (the active layer) but still, I don't see the symbol in the drawing. Oh, and I'm doing this in CMenu_EventSink::DoInterface();