Dashed style lines view corrupted after drag (Editor Control)

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Dashed style lines view corrupted after drag (Editor Control)

Post by AliHatam » 10 Oct 2021, 18:45

Hi
We have strange problem with Editor control .
We draw a cad drawing on the editor (by code) and all thing is ok .
In the editor , when we drag the drawn image , some dashed style lines views become corrupted .
for example , if I click in spot A and drag or I click on element B, the corruption occurs . but if I click and drag in spot C nothing occurs and views stay OK.

Ok state :
Image

views corrupted state :
Image

yellow dashed style lines view corrupted and some lines disappears .

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by support » 11 Oct 2021, 12:39

Hello,

First of all please make sure that the drawing was created correctly, e. g. the Load and the GetSection methods were not omitted. You can see how to create entities correctly in the AddEntites demo of CAD .NET. Also please make sure that you do not forget to implement rerendering after drag and drop - CadPictBox.Invalidate().

If this does not help, please provide us the CAD drawing you're working with, the code you used to create this drawing and the exact version of the CAD .NET assembly (CADImport.dll) you're using. You can forward this information to our e-mail, e. g. to support@cadsofttools.com

Regards
Andrei
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by AliHatam » 11 Oct 2021, 17:14

Hi
How I must implement rerendering after drag and drop ?
Has it an event ?

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by support » 11 Oct 2021, 17:27

CadPictBox.Invalidate()

This is the way to implement rerendering.

Regards
Andrei
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by AliHatam » 11 Oct 2021, 18:22

How I do it just after drag and drop ?

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by support » 12 Oct 2021, 11:56

Ali

You just need to call cadPictBox.Invalidate

cadPictBox is an instance of the CADPictureBox control where the image is drawn. You can find out more on it
in our documentation:
https://cadsofttools.com/help/cadnet/index.html

You can find out more on the Invalidate method in the Windows Forms documentation, this method is not unique to CAD .NET:
https://docs.microsoft.com/en-us/dotnet ... esktop-5.0

Ultimately you can check the CAD .NET demos, this method is shown in any of them:
a216-e701-c402-4a07.png
a216-e701-c402-4a07.png (5.55 KiB) Viewed 4272 times
This is an example from the Editor demo, cadPictBox.Invalidate is called after selection clearing:
3194-e3b2-b1cb-ce3c.png
3194-e3b2-b1cb-ce3c.png (8.91 KiB) Viewed 4272 times
We hope this information will help.

Regards
Andrei
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Dashed style lines view corrupted after drag (Editor Control)

Post by AliHatam » 01 Feb 2022, 11:04

My problem solved by disabling snap feature in tool box .

Post Reply