How to style correctly dimensions for DimDataused in Jigs and entities grips?

How to style correctly dimensions for DimDataused in Jigs and entities grips?

maisoui
Advocate Advocate
836 Views
2 Replies
Message 1 of 3

How to style correctly dimensions for DimDataused in Jigs and entities grips?

maisoui
Advocate
Advocate

Hi,

 

I'd like to create DimData (AcDbDimDataPtrArray) in my jig and my custom entity. I was able to reproduce the correct behaviour (like AutoCAD polyline), but it seems I have not initializing correctly the style of the dimension, because the result is not identical (look at the two pictures).

 

AutoCAD PLINE jig (during pan)

acedjig_dimstyle2.png

 

My jig  (during pan) - "errors" in red circle

acedjig_dimstyle1.png

 

Here is what I did:

I overrided the two following methods in my Jig (AcedJig) to provide DimData:

virtual AcDbDimDataPtrArray * dimData(const double dimScale);
virtual Acad::ErrorStatus setDimValue(const AcDbDimData * pDimData, const double dimValue);

 

In the first method, I create a simple AlignedDimension like this:

...

AcDbAlignedDimension * pDimension = new AcDbAlignedDimension;
pDimension->setDatabaseDefaults();
pDimension->setNormal(m_pEntity->normal());
pDimension->setElevation(m_pEntity->elevation());
pDimension->setDimscale(dimScale);
pDimension->setHorizontalRotation(0.);

AcDbDimData * pDimData = new AcDbDimData(pDimension);
pDimData->setDimFocal(true);
pDimData->setDimHideIfValueIsZero(true);
pDimData->setDimEditable(true);

m_dimData.append(pDimData);

return &m_dimData;

 

Maybe I need to call setDimensionStyle? But which style to use? I did not find any example in the Object ARX, any suggestions are welcomed.

 

Regards,

Jonathan

 

 

--
Jonathan
0 Likes
Accepted solutions (1)
837 Views
2 Replies
Replies (2)
Message 2 of 3

fenton_webb
Autodesk
Autodesk
Accepted solution

are you missing the call to setDynamicDimension(true)?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 3

maisoui
Advocate
Advocate

Perfect! That is what I was looking for. I tried a lot of things by changing style properties, but I was in a wrong way.
Thank you very much for your answer.

--
Jonathan
0 Likes