Jump to content

Cmb

Member
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Cmb

  1. Dear SDK experts, We struggle to draw temporary text from one of our tool. Based on an old post on this forum, and answer from Hippocode : there, we try to draw a temporary text block using this piece of code, but nothing happens. The same example is working fine with basic obj types such as 2d line or 3d polylines, but impossible to get a temporary text from a kTextNode. ::Draw(IToolDrawProvider* draw_provider) { if (context_.state == ToolContextData::kProcessState) { VectorWorks::IToolInteractiveDrawPtr tool_interactive_draw; gSDK->GetCurrToolInteractiveDraw(&tool_interactive_draw); if (tool_interactive_draw) { VWTextBlockObj text_block(tool_interactive_draw->GetObjectW(kTextNode)); text_block.DeleteText(); text_block.AppendText("10000"); // for example tool_interactive_draw->SetObjectTransform() based on mouse tool_interactive_draw->UpdateObject(kTextNode); } WorldCoord perspective_distance, clip_distance; WorldRect redraw_r; gSDK->GetPerspectiveInfo(gSDK->GetActiveLayer(), perspective_distance, clip_distance, redraw_r); gSDK->RedrawRect(redraw_r); this->UpdatePreview(); } We also tried to pre-allocate textblocks and then display / move / delete them from Draw or MouseMove functions, but it didn't displayed well. Is there any way to draw any kind of text while the tool is active ? Thank you for your answers Have a good day!
  2. Thank you for your answer Stefan. We are still on the VS2020 version, and we don't have the header ObjectsVariables.h, but MiniCadCallbacks.h. We found the value 1054 by inspecting VW2023 SDK. TVariableBlock var; gSDK->GetObjectVariable(vp_obj, 1054, var); //ovIsSectionViewport only in 2023 bool is_section_viewport; var.GetBoolean(is_section_viewport); I tried reading tha value for viewports, but the behaviour is not what I expected. As soon as one viewport in my sheet layer is a section viewport, all viewports (standard viewports and section viewports) will return true. Is this the expected behaviour ? Thanks again for your help, Olivier
  3. Hi dear community, I'm trying to iterate over viewports in a sheet layer and want to skip sections viwports. I tried many ways, but none gives results. VWViewportObj vp_obj(h); auto type = vp_obj.GetType(); auto is_section = vp_obj.IsHorizontalSection(); bool is_section2; vp_obj.GetIsDesignLayerSectionViewport(is_section2); returned type is always viewport (const short kViewportNode = 122;) (which is expected), but is_section and is_section2 always return false for my cases (a mix of standard viewports and section viewports); I found the enum values I need, but cannot find the function to call to get them. Thank you in advance for your help. Cmb Cmb
  4. The solution i found was to use the reshape event of the wall obj through the update support of the sdk , and to find my object in it : @Hippocode indeed a new copy of the object is made in the wall at insertion time, so i also have to find a way for that
  5. Hello, I made a plug-in object with the option to be inserted in walls, therefore its SParametricDef structure has resets on move / rotate, and wall insertion enabled. When the object inserted in a wall is moved while staying inside the wall, its recalculate event won't be triggered. This is an issue for me as I need my object to be recalculated after a position change inside the wall aswell. I found the following init property which is obsolete : Is there another way to reset the object in wall ? Do i have to catch a move event for this pio type and then reset the object if it is inside a wall ? thx for help
  6. Hello, Here are linked 2 videos to support the fact of a difference in behavior between VW2015 and VW2020. We have the same design layer in both versions, and what we do is about 10 times the resets of the plug-in objects in the drawing. In this case we use native VW plug-in objects (doors and column), but it does exactly the same with custom made plug-in objects. It does it also with the others 3D render modes (not only Open GL). As you can see, in VW2020 the objects are flashing / becoming transparent during the time of each reset. We'd like the objects to remain still as it was in VW2015. Is there a setting for that ? Is it normal in newer versions, do you happen to have the same behavior in VW2020 ? Our OS is Windows 10. Thanks for your answers. there are the videos : VW2015 : resets_VW2015.mp4 VW2020 : resets_VW2020.mp4
  7. Cmb

    How to group Undo Events ?

    So regarding this specific case, my problem was relative to VCOMImpl<IProviderShapePane> ::OnWidgetChange(SShapePaneWidgetOnWidgetChange& data, bool& outNeedReset) I realised that outNeedReset beeing "true" was the cause of a second separated Undo event. Setting this boolean to "false" and doing the reset of the object myself permitted to Undo all I wanted with only one CTRL+Z. For other cases I used the various swap commands as you told me and it worked. Thank you
  8. Hi, I am struggling with a specific case that was working fine in VectorScript, but not with the SDK. Basically, I have a PIO which is creating multiple objects as kids with CreateCustomObject(), + changing one of its parameter with setParamString. This is triggered from a button in its pane. The expected behavior is to undo all of this with CTRL+Z. But I have to press CTRL+Z a first time and that will cancel the objects creation, and then CTRL+Z a second time to get the changed parameter back. It's not the case in VectorScript with pretty much the same code. I tried to use the Undo Events primitives of the SDK but don't achieved what I wanted, maybe I was doing it wrong. Is there a way to group these undo 'events' together ? Thanks,
  9. Thanks to both of you for your answers. For the moment, I have no success reading minidump files. I'll try to know more about pdb and symbols to get something.
  10. Hello, I need to get the state of the execution of VW after loading my plugins. (if it crashed or executed well), when I build in Release. Is there a way to know when the program exits ? Or it 's impossible to catch this event via the SDK ? Because of the COM mechanisms, the entry point is called multiple times and i'm not sure if we can know when it closes. An idea was to try catch(...) all, but the sdk isn't using exceptions neither my plugins. Without writing own exceptions at plugins level, meybe there is another way to get a trace slighty like a debugger would do, but in Release ? (with .pdb, or crashdumpfile ? But how in the context of the SDK..) Thank you very much for helping,
  11. If you look at the drawing Tree or try to ungroup your Dimension object (CTRL + U), you will find out that there are Lines Nodes and a Text Node : You can then easily change the charSize of the Text Object with for example : virtual void ISDK::SetTextSize(MCObjectHandle textBlock, Sint32 firstChar, Sint32 numChars, WorldCoord charSize); Best,
  12. Hello ! I'd like to know if there is an equivalent as this method in Vectorscript in the SDK : AddAssociation(obj1, kOnDeleteDelete, obj2); or what is the best way to have the same behavior, as I want to delete a child when an Object is removed. I also tried to catch the event in VWParametric_EventSink, but can't find a virtual for that. Is there a way to do this without having to override : virtual Sint32 VCOM_CALLTYPE Execute(ParametricMessage* message); Thanks
×
×
  • Create New...