Jump to content
Developer Wiki and Function Reference Links ×

Extra locus point inserting with custom object


JBenghiat

Recommended Posts

I have a particular custom object and insertion tool that is inserting a locus point at the first click point in addition to the object. I just searched the entire code, and I'm not actually creating this locus point, so it seems to happen either as part of some default action or because I'm not flagging something as handled. Anyone have any ideas where it might be coming from?

Link to comment

I think I might have seen something like this like 15 years ago when PIOs were first added. Too long ago to really remember.

 

I think what was happening was that if an invalid object was inserted it was replaced by a locus at the insertion point. Is your insertion tool accidentally inserting two objects including one before it is really set up with the object you want to insert?

 

Complete guess but happy to look at the code if you want to DM it.

Link to comment

ok, that's got me in the right direction.

 

I'm overriding VWToolDefaultPoint_EventSink::PointAdded()

 

If at the end of the block, I call VWToolDefaultPoint_EventSink::PointAdded(), I get the extra locus points. However, if I don't call it, after the first click, I'm not getting the preview of the object while it's rotating.

Link to comment

Josh,

   Based on your last comment, this may not be related, but another way to get a locus is to delete a SymDef when that Symbol is still in the drawing. You mentioned Locus which I interpret as a 2D Locus. Deleting a SymDef would leave 3D Loci in the drawing. If you are getting a 2D Locus, then this is not the reason why.

 

Raymond

Link to comment
23 hours ago, JBenghiat said:

I'm overriding VWToolDefaultPoint_EventSink::PointAdded()

 

If at the end of the block, I call VWToolDefaultPoint_EventSink::PointAdded(), I get the extra locus points. However, if I don't call it, after the first click, I'm not getting the preview of the object while it's rotating.

 

That's odd, I'm doing the same thing (overriding and calling VWToolDefaultPoint_EventSink::PointAdded(); at the end) and don't get that locus...

If it helps, I have this in the VWToolDefaultPoint_EventSink::Draw(IToolDrawProvider* pDrawProvider) function:

pDrawProvider->DrawDefault2D();

 

And in TToolStatus VWToolDefaultPoint_EventSink::GetStatus(const IToolStatusProvider* pStatusProvider)

return pStatusProvider->GetTwoPointToolStatus();

Link to comment

For me, 

pDrawProvider->DrawDefault2D();

will draw a line, and not the preview of the object. I need to call:

VWToolDefaultPoint_EventSink::Draw( pDrawProvider );

 

This is also definitely a change for 2021. Prior, I would get the object preview even without calling the default Draw() method, and that seems to be the case for all my tools.

 

I'm also returning the two point tool status.

 

I seem to be stuck between having the extra locus point or not seeing the object preview during rotation, which is fairly important for the application. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...