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)
My jig (during pan) - "errors" in red circle
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
Solved! Go to Solution.
Solved by fenton.webb. Go to Solution.
are you missing the call to setDynamicDimension(true)?
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.