How to use Dimension Styles
Posted: 27 Nov 2009, 00:13
Hi,
I've uploaded a dwg file which contains my default dimension style.
In the following I'm trying to use Dimension Styles and try to give a dimension.
It seems it is not using the dimension Style.
What am I missing?
Thanks
Aby
I've uploaded a dwg file which contains my default dimension style.
In the following I'm trying to use Dimension Styles and try to give a dimension.
It seems it is not using the dimension Style.
What am I missing?
Thanks
Aby
Code: Select all
FDwgNavigator = new TSGDrawingNavigator(FForm);
FDwgNavigator->Parent = FForm;
FDwgNavigator->Align = alClient;
FDwgNavigator->AutoFocus = true;
FDwgNavigator->Anchors = FDwgNavigator->Anchors << akLeft << akTop << akRight << akBottom;
FDwgNavigator->Picture->Graphic = NULL;
FDwgNavigator->Update();
FDwgNavigator->LoadFromFile(ResFileName);
FCADImage = dynamic_cast<TsgDXFImage *> (FDwgNavigator->Picture->Graphic);
FCADImage->BackgroundColor = clBlack;
FCADImage->DefaultColor = clWhite;
FDXFConverter = FCADImage->Converter;
if (FCADImage->SelectionMatrix == NULL)
FCADImage->SelectionMatrix = new TsgSelectionMatrix();
FCADImage = dynamic_cast<TsgCADImage *> (FDwgNavigator->Picture->Graphic);
FCADImage->SetMatrixMode(smEnabled);
FCADImage->GetExtents();
TsgDXFDimension *ProDim = NULL;
for (int I = 0; I < FDXFConverter->Counts[csEntities]; ++I) {
ProDim = dynamic_cast<TsgDXFDimension *> (FDXFConverter->Entities[I]);
if (ProDim) break;
}
FForm->Show();
TsgDXFDimension *sgDms = new TsgDXFDimension;
// sgDms->AssignEntity(ProDim); // This is not working Should'nt have to work?
sgDms->Flags = 0;
sgDms->LinDefPoint1 = MakeFPoint(0,0,0);
sgDms->LinDefPoint2 = MakeFPoint(100,0,0);
sgDms->DefPoint = MakeFPoint(100,-25,0);
sgDms->Style = ProDim->Style;
sgDms->TextStyle = ProDim->TextStyle;
sgDms->Layer = ProDim->Layer;
FCADImage->CurrentLayout->AddEntity(sgDms);
FCADImage->Converter->Loads(sgDms);
FCADImage->RefreshCurrentLayout();
FCADImage->GetExtents();