Assigning entities
Moderators: SDS, support, admin
Assigning entities
Hi,
I'm trying to copy entities from one drawing to another. I'm selecting entities from one drawing, pressing a button, then it copies selected entities to the new drawing. So far so good everything is fine. But I have some problems.
Here are the problems that I'm encountering.
1) The copied entities could not be selected. The newly created TsgDXFImage objects GetPoint method is returning (0,0) point. It can not transform the world coordinates to device coordinates.
TPoint vTL = FDXFImg->GetPoint(Entity->Box.TopLeft);
vTL is (0,0). This is very important. How can I impose the transformation. What can be done?
2) Some lines has different linetypes. For example a dashdot linetype. Although I'm adding the LType to the new Converter as shown in the following, linetypes are still "Continous". What am I missing?
DXFConverter->Sections[csLTypes]->AddEntity(LType);
3) It seems Hatch entities are copied but not displayed. Why?
Thanks
Aby
I'm trying to copy entities from one drawing to another. I'm selecting entities from one drawing, pressing a button, then it copies selected entities to the new drawing. So far so good everything is fine. But I have some problems.
Here are the problems that I'm encountering.
1) The copied entities could not be selected. The newly created TsgDXFImage objects GetPoint method is returning (0,0) point. It can not transform the world coordinates to device coordinates.
TPoint vTL = FDXFImg->GetPoint(Entity->Box.TopLeft);
vTL is (0,0). This is very important. How can I impose the transformation. What can be done?
2) Some lines has different linetypes. For example a dashdot linetype. Although I'm adding the LType to the new Converter as shown in the following, linetypes are still "Continous". What am I missing?
DXFConverter->Sections[csLTypes]->AddEntity(LType);
3) It seems Hatch entities are copied but not displayed. Why?
Thanks
Aby
Hi,
<ol type="1">
<li>As far as we know you use <b>CAD Import VCL v.6.1</b>. This version contains just basis for copying entities. That is why sometimes an inaccuracy may happen while copying an entity from one TsgDXFImage object in to another.
BTW: the following line:
will work correctly only if an image has been drawn though once.</li>
<li>Adding a linetype object is not enouph. It must be assinged to an entity. It is necessary to use TsgDXFEntity->SetLType().</li>
<li>Hatch is a very complicated entity itself. That is why it is necessary to consider every concrete case.</li></ol id="1">
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<ol type="1">
<li>As far as we know you use <b>CAD Import VCL v.6.1</b>. This version contains just basis for copying entities. That is why sometimes an inaccuracy may happen while copying an entity from one TsgDXFImage object in to another.
BTW: the following line:
Code: Select all
TPoint vTL = FDXFImg->GetPoint(Entity->Box.TopLeft);
<li>Adding a linetype object is not enouph. It must be assinged to an entity. It is necessary to use TsgDXFEntity->SetLType().</li>
<li>Hatch is a very complicated entity itself. That is why it is necessary to consider every concrete case.</li></ol id="1">
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
Hi Sergey,
Thanks for you posts.
" TPoint vTL = FDXFImg->GetPoint(Entity->Box.TopLeft);
will work correctly only if an image has been drawn though once."
How can an Image cannot be drawn though once? What does it mean.
I am drawing the entities as shown in the following.
DXFImg->GetExtents();
DwgNavigator->Picture->Graphic = DXFImg;
DwgNavigator->FitToSize();
Form->Show();
My questions was and is .
What can be <b>done</b>?
How can I restart the transformation?
Is it possible to select the newly created entities or not?
Aby
Thanks for you posts.
" TPoint vTL = FDXFImg->GetPoint(Entity->Box.TopLeft);
will work correctly only if an image has been drawn though once."
How can an Image cannot be drawn though once? What does it mean.
I am drawing the entities as shown in the following.
DXFImg->GetExtents();
DwgNavigator->Picture->Graphic = DXFImg;
DwgNavigator->FitToSize();
Form->Show();
My questions was and is .
What can be <b>done</b>?
How can I restart the transformation?
Is it possible to select the newly created entities or not?
Aby
"Adding a linetype object is not enouph. It must be assinged to the an entity. It is necessary to use TsgDXFEntity->SetLType()."
Even if you use DXFEntity->SetLType(), line is drawn continously.
You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.
Try a little program, you'll replicate this bug.
Thanks
Aby
Even if you use DXFEntity->SetLType(), line is drawn continously.
You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.
Try a little program, you'll replicate this bug.
Thanks
Aby
Hi,
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I am drawing the entities as shown in the following.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
This code will work:
This code will not work:
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Is it possible to select the newly created entities or not?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Newly created entities must be available for selection by definition.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Even if you use DXFEntity->SetLType(), line is drawn continously.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It must be a visualization problem. Try to change DXFEntity->LineTypeScale parameter.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
When you call Assign function to copy an entity from the one CAD image to another, a reference is being copied only. So, an exception will arise when source CAD image is deleted. That is why linetype object must be recreated in the destination CAD image.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I am drawing the entities as shown in the following.
Code: Select all
DXFImg->GetExtents();
DwgNavigator->Picture->Graphic = DXFImg;
DwgNavigator->FitToSize();
Form->Show();
This code will work:
Code: Select all
TsgDXFImage *FImg = dynamic_cast<TsgDXFImage *> (DwgNavigator->Picture->Graphic);
FImg->GetPoint();
Code: Select all
DXFImg->GetPoint()
Newly created entities must be available for selection by definition.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Even if you use DXFEntity->SetLType(), line is drawn continously.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It must be a visualization problem. Try to change DXFEntity->LineTypeScale parameter.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
When you call Assign function to copy an entity from the one CAD image to another, a reference is being copied only. So, an exception will arise when source CAD image is deleted. That is why linetype object must be recreated in the destination CAD image.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by support</i>
<br />Hi,
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I am drawing the entities as shown in the following.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
This code will work:
This code will not work:
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Is it possible to select the newly created entities or not?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Newly created entities must be available for selection by definition.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Even if you use DXFEntity->SetLType(), line is drawn continously.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It must be a visualization problem. Try to change DXFEntity->LineTypeScale parameter.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
When you call Assign function to copy an entity from the one CAD image to another, a reference is being copied only. So, an exception will arise when source CAD image is deleted. That is why linetype object must be recreated in the destination CAD image.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
<br />Hi,
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I am drawing the entities as shown in the following.
Code: Select all
DXFImg->GetExtents();
DwgNavigator->Picture->Graphic = DXFImg;
DwgNavigator->FitToSize();
Form->Show();
This code will work:
Code: Select all
TsgDXFImage *FImg = dynamic_cast<TsgDXFImage *> (DwgNavigator->Picture->Graphic);
FImg->GetPoint();
Code: Select all
DXFImg->GetPoint()
Newly created entities must be available for selection by definition.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Even if you use DXFEntity->SetLType(), line is drawn continously.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It must be a visualization problem. Try to change DXFEntity->LineTypeScale parameter.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">You shouldn't have to call SetLType() function, Assign function is and must call the SetLType. SetLType is called because, debugger tells so.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
When you call Assign function to copy an entity from the one CAD image to another, a reference is being copied only. So, an exception will arise when source CAD image is deleted. That is why linetype object must be recreated in the destination CAD image.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">