Beautiful dimensions of width and height on Boundary Box Sketch in the drawing view of Flat-pattern

Programming and macros
User avatar
mihkov
Posts: 44
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 17
x 24

Beautiful dimensions of width and height on Boundary Box Sketch in the drawing view of Flat-pattern

Unread post by mihkov »

Task: There is a part with sheet metal. For it, a drawing is created with one view of Flat-pattern. For this view, the Sketch of the Boundary Box is displayed. Next, we define 2 perpendicular elements among the elements of this sketch (or simply by the names Line1 and Line4, at least that way). and put sizes on them. And most importantly, what I could not find explicitly (I could not repeat correctly), the size should be placed in the middle of the line at some distance(We need to determine where the outer side of the Boundary Box rectangle.), as engineers do in the drawing.
In essence, we need to get a dimensional drawing of a Flat-pattern.
I'm confused about the coordinate system conversion functions.
I looked at these examples, but could not put together anything that worked in any way:
https://www.codestack.net/solidworks-ap ... end-lines/
https://www.codestack.net/solidworks-ap ... -entities/
https://help.solidworks.com/2021/englis ... ple_vb.htm
Boundary Box.jpg
What I'm most interested in is: correctly creating a display dimension on a sketch and placing its display text in the correct place. Well, processing the sketch itself, how to do it correctly.
AmenJlili
Posts: 8
Joined: Thu Nov 30, 2023 5:17 pm
Answers: 0
x 6

Re: Beautiful dimensions of width and height on Boundary Box Sketch in the drawing view of Flat-pattern

Unread post by AmenJlili »

Maybe I'm reading too much into but you need to get the extreme points first of the flat pattern body and transform those to the coordinate system of the view from in the drawing. From there you can select the vertices and add the dimension. There are two settings in the display dimension where you can center the text and align it either horizontally or vertically.

You can probably get those from the macro recorder. I think SetDimBrokenLeader(swDisplayDimensionLeaderText_e) is the one you will need for the text alignment.


Amen
cadoverflow.com
bluebyte.biz
Post Reply