Hi,
We have a requirement to get a program which can perform below
with objective towards drawing automation and Quality.
Once executed the program should capture Zone Values in a excel for all drawing sheets for below
1. View Titles
2. View Callouts
3. Datums
4. Balloons which call the item numbers in BOM
At next level of program improvement, I like to cover below with help from Forum members or based on my learnings.
5. Identify Scale values which are non-standard
6. Identify non-standard View title naming such as I, O, Q, S, X, and Z
7. Identify non-standard Datum naming such as I, O, Q
All our drawings are of size A0 - 1189 x 841mm with Zone namings as below.
Horizontal Zones: 1 to 20 (Right to Left)
Vertical Zones: A to P (Bottom to Top) - (14 Grids since I & O are omitted)
So each grid measures around 60mm.
Below thread regarding zone for dimensions is similar to my requirement, but Iam not concerned about location of dimensions.
http://nxjournaling.com/content/regarding-zone-location-diimensions-nx-d...
I couldn’t take it further due to my limited programming knowledge.
Request help from forum members.
re: zone locations
What version of NX are you running?
The "ReportDimensionSheetZone" function in the code currently only accepts dimensions as input, but it could easily be changed to work with any object that has an .AnnotationOrigin property.
Zone Locations
Hi,
Thanks for your response.
Iam using Nx 9.0
I was assuming your response, but couldn't work it out by using correct functions and classes. And when it comes to new type of classes or functions, Iam clueless regarding syntax usage since Iam new to programming.
If I get a sample code on a particular case, may be View titles or balloons, I may work through.
Below are few of the Classes & Functions Iam exploring.
ViewLocation Property / AssemblyDrawingBuilder
LabelPosition Property / ViewLabelBuilder
BalloonText Propery / BalloonNoteBuilder
AnnotationOrigin Property / Annotation
Need help from forum members regarding.
Udhay M
Aerospace Design Engineer
re: annotation zone
The function has been modified to accept any annotation object (dimension, note, ID symbol, etc). It has not been modified to skip certain letters. Please verify that this works for your ID symbols and other items that you want to pass in.
Function ReportAnnotationSheetZone(ByVal theSheet As Drawings.DrawingSheet, ByVal theAnnotation As Annotations.Annotation) As String
'sheet number / vertical zone / horizontal zone
Dim borderBuilder As Drawings.BordersAndZonesBuilder
If IsNothing(theSheet.BordersAndZones) Then
Return Nothing
End If
borderBuilder = theSession.Parts.Work.Drafting.BordersAndZonesObjects.CreateBordersAndZonesBuilder(theSheet.BordersAndZones)
Dim numHorizontalZones As Integer = (theSheet.Length - borderBuilder.LeftMargin - borderBuilder.RightMargin) / borderBuilder.HorizontalSize
Dim numVerticalZones As Integer = (theSheet.Height - borderBuilder.BottomMargin - borderBuilder.TopMargin) / borderBuilder.VerticalSize
'calculate zone wrt bottom left of drawing (ZoneOrigin.BottomLeft)
Dim Hcell As Double = (theAnnotation.AnnotationOrigin.X - borderBuilder.LeftMargin) / borderBuilder.HorizontalSize
Dim Vcell As Double = (theAnnotation.AnnotationOrigin.Y - borderBuilder.BottomMargin) / borderBuilder.VerticalSize
Hcell = Math.Ceiling(Hcell)
Vcell = Math.Ceiling(Vcell)
Dim theZoneOrigin As Drawings.BordersAndZonesBuilder.ZoneOrigin = borderBuilder.Origin
borderBuilder.Destroy()
Dim verticalLetterNum As Integer
Dim verticalLetter As Char
Dim horizontalNum As Integer
If theZoneOrigin = Drawings.BordersAndZonesBuilder.ZoneOrigin.BottomLeft Or theZoneOrigin = Drawings.BordersAndZonesBuilder.ZoneOrigin.TopLeft Then
'origin on left side
horizontalNum = Hcell
Else
'origin on right side
horizontalNum = numHorizontalZones - Hcell + 1
End If
If theZoneOrigin = Drawings.BordersAndZonesBuilder.ZoneOrigin.BottomLeft Or theZoneOrigin = Drawings.BordersAndZonesBuilder.ZoneOrigin.BottomRight Then
'origin on bottom
verticalLetterNum = Asc("A") + Vcell - 1
verticalLetter = Chr(verticalLetterNum)
Else
'origin on the top
verticalLetterNum = Asc("A") + numVerticalZones - Vcell
verticalLetter = Chr(verticalLetterNum)
End If
Dim theSheetNum As String = SheetNumber(theSheet)
Return theSheetNum & verticalLetter & horizontalNum.ToString
End Function