ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
maisoui
595 Views, 2 Replies

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

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
2 REPLIES 2
Message 2 of 3
fenton.webb
in reply to: maisoui

are you missing the call to setDynamicDimension(true)?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 3
maisoui
in reply to: fenton.webb

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost