Dimensions adapted according to the size of the plate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I hope you can help me.
I have the following code:
Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim Front_View = Sheet_1.DrawingViews.ItemByName("Front_View")
Dim Left_Face = Front_View.GetIntent("Left_Face")
Dim Bottom_Face = Front_View.GetIntent("Bottom_Face")
Dim Bottom_Face_Square = Front_View.GetIntent("Bottom_Face_Square")
Dim Top_Face_Square = Front_View.GetIntent("Top_Face_Square")
Dim Right_Face_Square = Front_View.GetIntent("Right_Face_Square")
Dim Left_Face_Square = Front_View.GetIntent("Left_Face_Square")
Dim WPO_Edge_Front_Square = Front_View.GetIntent("WPO_Edge_Front_Square")
Dim WPO_Edge_Left_Square = Front_View.GetIntent("WPO_Edge_Left_Square")
Dim WPO_Edge_Top_Square = Front_View.GetIntent("WPO_Edge_Top_Square")
Dim WPO_Edge_Front_Bottom = Front_View.GetIntent("WPO_Edge_Front_Bottom")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
'Calculations 47,5
Dim TopWidthPos = ThisDrawing.Geometry.Point2d(0, 0)
TopWidthPos.InDatabaseUnits = WPO_Edge_Left_Square.PointOnSheet
TopWidthPos.Y = TopWidthPos.Y - 190 * Front_View.Scale
'Calculations 185
Dim TopLengthPos = ThisDrawing.Geometry.Point2d(0, 0)
TopLengthPos.InDatabaseUnits = WPO_Edge_Top_Square.PointOnSheet
TopLengthPos.Y = TopWidthPos.Y - 2 * Front_View.Scale
'Calculations 140
Dim LengthPos = ThisDrawing.Geometry.Point2d(0, 0)
LengthPos.InDatabaseUnits = WPO_Edge_Left_Square.PointOnSheet
LengthPos.X = LengthPos.X - 67 * Front_View.Scale
'Calculations 70
Dim HeighPos = ThisDrawing.Geometry.Point2d(0, 0)
HeighPos.InDatabaseUnits = WPO_Edge_Front_Bottom.PointOnSheet
HeighPos.X = HeighPos.X - 160 * Front_View.Scale
ThisDrawing.BeginManage
Dim linDim1 = genDims.AddLinear("Width", TopWidthPos, Left_Face, Left_Face_Square)
Dim linDim2 = genDims.AddLinear("SquareLength", TopLengthPos, Right_Face_Square, Left_Face_Square)
Dim linDim3 = genDims.AddLinear("Length", LengthPos, Top_Face_Square, Bottom_Face_Square)
Dim linDim4 = genDims.AddLinear("Heighh", HeighPos, Bottom_Face, Bottom_Face_Square)
linDim1.NativeEntity.Tolerance.SetToDeviation(0.1, -0.1)
linDim1.NativeEntity.TolerancePrecision = 0
linDim2.NativeEntity.Tolerance.SetToDeviation(0.1, -0.1)
linDim2.NativeEntity.TolerancePrecision = 0
linDim3.NativeEntity.Tolerance.SetToDeviation(0.1, -0.1)
linDim3.NativeEntity.TolerancePrecision = 0
linDim4.NativeEntity.Tolerance.SetToDeviation(0.1, -0.1)
linDim4.NativeEntity.TolerancePrecision = 0
'linDim3.NativeEntity.Text.FormattedText = String.Concat("<DimensionValue/>", " x 4")
ThisDrawing.EndManage
It works really well and as such as intended.
I have a plate, pleace see the image Test1
The image, Test1 shows a standard which I work from.
When I change the size of the plate, for example 400 x 400 mm,
the dimensions of the automated working drawing are not adjusted.
Please see picture "Test"
Can you help me change the code so that the goals are adapted according to the size of the plate.