ObjectARX

Reply
Distinguished Contributor
maisoui
Posts: 127
Registered: ‎12-07-2009
Message 1 of 3 (156 Views)
Accepted Solution

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

156 Views, 2 Replies
08-06-2013 04:48 AM

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
ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 3 (136 Views)

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

08-06-2013 05:15 PM in reply to: maisoui

are you missing the call to setDynamicDimension(true)?





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Distinguished Contributor
maisoui
Posts: 127
Registered: ‎12-07-2009
Message 3 of 3 (129 Views)

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

08-06-2013 11:07 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community