Add Dimensions in Draft file via API

Can someone point me in the right direction on how to place dimensions on a Draft document through the API? The .NET Programmer's Guide has an example for placing dimensions in a Part document but I need to know how to do it in a Draft document.

 

Thanks

 

 

Posted by: Terry Tyson
Post date: 7/13/2011 7:03:17 AM

2 REPLIES

RE: Add Dimensions in Draft file via API

This appears to be the path you seek:

 

From the draft document get the sheets collection. From sheets get the sheet (or 'activesheet", which can be obtained from the document) you want to add dims to. Get the dimensions collection from the sheet. The collection has add methods.

 

'getting the Active Sheet object

Set objSheet = objDoc.ActiveSheet

 

'create a line2d

Set objline = objSheet.Lines2d.AddBy2Points(0.1, 0.1, 0.3, 0.3)

 

'create a dimension object

Set objDimension = objSheet.Dimensions.AddLength(object:=objline)

 

 

Posted by: R.D. Holland
Post date: 7/27/2011 11:43:59 AM

Highlighted

RE: Add Dimensions in Draft file via API

Thanks for the input. I still need to learn how to identify the objects in a view and place a dimension from a specific point on one to a specific point on another.

 

Posted by: Terry Tyson
Post date: 8/5/2011 6:03:00 AM