Hello,
I have a problem to find how the Section line letters are related with Section View Label.
I know how to for example change the letter in Sect View Label and than Section Line letters will automatically update:
theUFSession.Draw.AskViewLabel(view.Tag, out view_label_tag);
theUFSession.Draw.AskViewLabelParms(view_label_tag, ref parms);
but...
When we use Edit Text - Section Line Letters for section A-A are (in brackets <>):
1 - W!29539@SX_SEG_START_LETTER_ATTR
2 - W!29539@SX_SEG_END_LETTER_ATTR
But when I edit text for Section A-A View Label, I am getting a string:
SECTION W!28534@VWLETTER - W!28534@VWLETTER
When we copy/paste "W!29539@SX_SEG_START_LETTER_ATTR" or "W!29539@SX_SEG_END_LETTER_ATTR" or "W!28534@VWLETTER" in the Annotation text we get the same letter.
I have two lists : one with the tags of Section Line Letters and second one with the Section View Labels Tags. And my question is:
Is there any way to find this relation between the letters and view label ?
NX7.5.5/C#
I'll appreciate any help.
Similar question
Is it possible to get the evaluated text of these strings? GTAC has a sample to "report selected annotations text as stored and WYSIWYG", but evidently this uses options not available in 7.5.
Section Line Letters
I didin't find a function which translates this string into "real" text, but if it is be possible to get the evaluated text from these strings somehow that would be what I am looking for.
re: section letters
VWNAME
VWSCALE
VWLETTER
Are all attributes of the section view. In NX 7.5, right click on your section view and choose "properties". Press the "info" button and scroll down to the bottom of the page to find the attributes and their values. In code, you'd look at the values of the attribues.
I assume that
SX_SEG_START_LETTER_ATTR
SX_SEG_END_LETTER_ATTR
are attributes of the section line, but I have not been able to confirm that.
Need to add zone number along with view lable..(Detail View (E6)
' NX 9.0.0.19
' Journal created by 661324 on Tue Dec 29 11:14:25 2015 India Standard Time
'
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Insert->View->Detail...
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim nullDrawings_DetailView As Drawings.DetailView = Nothing
Dim detailViewBuilder1 As Drawings.DetailViewBuilder
detailViewBuilder1 = workPart.DraftingViews.CreateDetailViewBuilder(nullDrawings_DetailView)
theSession.SetUndoMarkName(markId1, "Detail View Dialog")
detailViewBuilder1.Type = Drawings.DetailViewBuilder.Types.Circular
Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("MilliMeter"), Unit)
Dim expression1 As Expression
expression1 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)
Dim part1 As Part = CType(theSession.Parts.FindObject("104W2105B001"), Part)
Dim partLoadStatus1 As PartLoadStatus
partLoadStatus1 = part1.LoadFeatureDataForSelection()
partLoadStatus1.Dispose()
Dim scalar1 As Scalar
scalar1 = workPart.Scalars.CreateScalar(1.0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)
Dim spline1 As Spline = CType(part1.Splines.FindObject("HANDLE R-15625"), Spline)
Dim point1 As Point
point1 = workPart.Points.CreatePoint(spline1, scalar1, SmartObject.UpdateOption.AfterModeling)
Dim component1 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("COMPONENT 104W2105B001 1"), Assemblies.Component)
Dim spline2 As Spline = CType(component1.FindObject("PARTIAL_PROTO#.Splines|HANDLE R-15625"), Spline)
Dim nXObject1 As NXObject
Dim xform1 As Xform
xform1 = workPart.Xforms.CreateExtractXform(spline2, SmartObject.UpdateOption.AfterModeling, False, nXObject1)
Dim point2 As Point
point2 = workPart.Points.CreatePoint(point1, xform1, SmartObject.UpdateOption.AfterModeling)
Dim scalar2 As Scalar
scalar2 = workPart.Scalars.CreateScalar(1.0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)
Dim point3 As Point
point3 = workPart.Points.CreatePoint(spline2, scalar2, SmartObject.UpdateOption.AfterModeling)
Dim baseView1 As Drawings.BaseView = CType(workPart.DraftingViews.FindObject("TOP@73"), Drawings.BaseView)
Dim xform2 As Xform
xform2 = workPart.Xforms.CreateXformWithView(baseView1, SmartObject.UpdateOption.AfterModeling)
Dim point4 As Point
point4 = workPart.Points.CreatePoint(point3, xform2, SmartObject.UpdateOption.AfterModeling)
detailViewBuilder1.BoundaryPoint1 = point4
detailViewBuilder1.Parent.View.Value = baseView1
detailViewBuilder1.Scale.Numerator = 2.0
detailViewBuilder1.Style.ViewStyleBase.PartName = "C:\Users\661324\Documents\TCS Confidential\INPUTS\Signature_Deletion\Tool\Without Error\104W2105.prt"
detailViewBuilder1.Style.ViewStyleGeneral.ViewRepresentation = Preferences.GeneralViewRepresentationOption.PreNx85Exact
detailViewBuilder1.Style.ViewStyleGeneral.ViewQuality = Preferences.GeneralViewQualityOption.Fine
detailViewBuilder1.Style.ViewStyleGeneral.ToleranceValue = 0.0515493
detailViewBuilder1.Style.ViewStyleGeneral.ExtractedEdges = Preferences.GeneralExtractedEdgesOption.None
detailViewBuilder1.Style.ViewStyleGeneral.AngleFormat = Preferences.AngleFormat.FractionalDegrees
detailViewBuilder1.Style.ViewStyleGeneral.AngleShowTrailingZeros = True
detailViewBuilder1.Style.ViewStyleGeneral.AngleDecimalPointCharacter = Preferences.DecimalPointCharacter.Period
detailViewBuilder1.Style.ViewStyleInheritPmi.CrosshatchPmiLwsv = True
Dim vieworigin1 As Point3d = New Point3d(-59.9999986613947, -40.00499249925, -1.0)
detailViewBuilder1.Style.ViewStylePerspective.ViewOrigin = vieworigin1
detailViewBuilder1.Style.ViewStyleSection.HiddenLineHatching = False
detailViewBuilder1.Style.ViewStyleSmoothEdges.ToleranceValue = 0.0
Dim expression2 As Expression
expression2 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)
Dim coordinates1 As Point3d = New Point3d(198.371645478492, 301.208830377528, 0.0)
Dim point5 As Point
point5 = workPart.Points.CreatePoint(coordinates1)
Dim expression3 As Expression
expression3 = workPart.Expressions.CreateSystemExpressionWithUnits("p2_x=198.371645478492", unit1)
Dim scalar3 As Scalar
scalar3 = workPart.Scalars.CreateScalarExpression(expression3, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)
Dim expression4 As Expression
expression4 = workPart.Expressions.CreateSystemExpressionWithUnits("p3_y=301.208830377528", unit1)
Dim scalar4 As Scalar
scalar4 = workPart.Scalars.CreateScalarExpression(expression4, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)
Dim expression5 As Expression
expression5 = workPart.Expressions.CreateSystemExpressionWithUnits("p4_z=0", unit1)
Dim scalar5 As Scalar
scalar5 = workPart.Scalars.CreateScalarExpression(expression5, Scalar.DimensionalityType.None, SmartObject.UpdateOption.AfterModeling)
Dim point6 As Point
point6 = workPart.Points.CreatePoint(scalar3, scalar4, scalar5, SmartObject.UpdateOption.AfterModeling)
detailViewBuilder1.BoundaryPoint2 = point6
Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.AddToDeleteList(point5)
Dim scaleAboutPoint1 As Point3d = New Point3d(-186.664108867428, -86.1691132572433, 0.0)
Dim viewCenter1 As Point3d = New Point3d(186.664108867427, 86.1691132572431, 0.0)
workPart.Views.WorkView.ZoomAboutPoint(0.8, scaleAboutPoint1, viewCenter1)
Dim point7 As Point3d = New Point3d(62.0619439859545, 92.9489884108911, 0.0)
detailViewBuilder1.Origin.Placement.SetValue(Nothing, workPart.Views.WorkView, point7)
Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Detail View")
detailViewBuilder1.Associative = True
Dim nXObject2 As NXObject
nXObject2 = detailViewBuilder1.Commit()
Dim nullPoint As Point = Nothing
detailViewBuilder1.BoundaryPoint1 = nullPoint
Dim nErrs2 As Integer
nErrs2 = theSession.UpdateManager.AddToDeleteList(point2)
detailViewBuilder1.BoundaryPoint2 = nullPoint
theSession.DeleteUndoMark(markId2, Nothing)
theSession.SetUndoMarkName(markId1, "Detail View")
theSession.SetUndoMarkVisibility(markId1, Nothing, Session.MarkVisibility.Visible)
detailViewBuilder1.Destroy()
Dim nErrs3 As Integer
nErrs3 = theSession.UpdateManager.AddToDeleteList(expression1)
Dim nErrs4 As Integer
nErrs4 = theSession.UpdateManager.AddToDeleteList(expression2)
Dim markId3 As Session.UndoMarkId
markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Start")
Dim detailViewBuilder2 As Drawings.DetailViewBuilder
detailViewBuilder2 = workPart.DraftingViews.CreateDetailViewBuilder(nullDrawings_DetailView)
detailViewBuilder2.Type = Drawings.DetailViewBuilder.Types.Circular
detailViewBuilder2.LabelOnParent = Drawings.DetailViewBuilder.LabelOnParentType.Note
theSession.SetUndoMarkName(markId3, "Detail View Dialog")
Dim expression6 As Expression
expression6 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1)
detailViewBuilder2.Destroy()
workPart.Expressions.Delete(expression6)
theSession.UndoToMark(markId3, Nothing)
theSession.DeleteUndoMark(markId3, Nothing)
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module
Rajeswari
re: view zone
There is some code here:
http://www.nxjournaling.com/comment/2759#comment-2759
that is similar to what you are looking for. The code will add the zone information to section views. With some work, it can be adapted for use with detail views.