Drawing Autodimension (width&heigth) Api

Hello ı want to give dimension to view in drawing but when ı try with smart dimension it gives unnecessary dimension. I just want to see width and height dimension.

    Dim vAnnotations As Variant
    vAnnotations = swModel.InsertModelAnnotations3(0, 32776, True, True, True, True)

ı dont understand this;
https://my.solidworks.com/reader/solidworks-forum/i9pxnAbkTYG9iFAfi1U-rQ/macro-that-adds-overall-dimensions-to-drawing-view

There’s no API for that, you have to build all of the logic yourself. That means analyzing the view, finding outer entities, transforming geometry and adding dimensions. I’ve done so as well :wink:

1 Like

May ı start from view outline or give bounding box and convert to sketch after that give dimension.

Set swView = swView.GetNextView
Do While Not swView Is Nothing
vOutline(nNumView) = swView.GetOutline
vPos(nNumView) = swView.Position
nNumView = nNumView + 1
Set swView = swView.GetNextView
Loop
I know your site. :smiley:
Also you have;

1 Like

The outline is, as I remember it, the size of the selectable area of a view. It’s about 10% bigger than the geometry of the view, so it has no relation to actual geometry.

Try the macro codes by Fifi Riri in this post https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/#community:yUw32GbYTEqKdgY7-jbZPg/iquestion:xLr8YA43QaGVCgWoXQd_sg