display Dimension

Hi,

I've seen other posts regarding troubles displaying dimensions, but wasnt able to derive an answer from there.
So here it goes again:

I'm constructing a dimension like such:

dim = AIS_LengthDimension(edg1,
edg2,
Geom_Plane(pl).GetHandle(),
100,
TCollection_ExtendedString('jelle')
)

Though when I display it:

display.Context.Display(dim.GetHandle())

Nothing is shown in the viewer.
Same thing with other dimension types.
What could I be doing wrong?

Thanks,

-jelle

zhangzhigang824's picture

Hello,

The follow is the code to display the AIS_RadiusDimension, it can work in my compute.

gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80);
TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c);
Handle(AIS_Shape) ais7 = new AIS_Shape(Ec);
myAISContext->Display(ais7);
Handle(AIS_RadiusDimension) rd = new AIS_RadiusDimension(Ec,80,"radius");
myAISContext->Display(rd);

You can have a try, good luck!

jelle's picture

Thanks zhangzhigang, you make it look so easy ;')