Quantcast
Channel: NX Journaling - .NET programming
Viewing all 67 articles
Browse latest View live

object Selection

$
0
0

Hello all,
How Can I select multiple objects but having a same name. for example, point, line and arc are having the same name.
so currently I am doing this.....
For Each tempObj As DisplayableObject In workPart.Curves
Dim mycase As String = tempObj.Name
Select Case mycase
Case "B200_50_05_01_G"
myobjects.Add(tempObj)
Case "B200_50_05_01_EG"
myobjects.Add(tempObj)
Case "B200_50_05_01_EN"
myobjects.Add(tempObj)
End Select
Next
For Each tempObj As DisplayableObject In workPart.Arcs
Dim mycase As String = tempObj.Name
Select Case mycase
Case "B200_50_05_01_G"
myobjects.Add(tempObj)
' lwd.WriteLine(tempObj.Name)
Case "B200_50_05_01_EG"
myobjects.Add(tempObj)
' lwd.WriteLine(tempObj.Name)
Case "B200_50_05_01_EN"
myobjects.Add(tempObj)
End Select
Next
For Each tempObj As DisplayableObject In workPart.Points
Dim mycase As String = tempObj.Name
Select Case mycase
Case "B200_50_05_01_G"
myobjects.Add(tempObj)
'lwd.WriteLine(tempObj.Name)
Case "B200_50_05_01_EG"
myobjects.Add(tempObj)
'lwd.WriteLine(tempObj.Name)
Case "B200_50_05_01_EN"
myobjects.Add(tempObj)
End Select

and so on, is there a better way, I don't want the user to select the objects, I am doing specific operations on a collection of objects, so I need those objects only.

Please help.


Dimension Origin

$
0
0

Hello All,
I am working on a application which will import the existing model(2d curves with dimensions), into drafting sheet of new model.
and I ma not able to handle the dimension text location properly, Even If I set the origins manually in the template and when it is imported it stays put. which is fine. but however, I also have to provide the options of moves these curves or scale them.
so that means the dimensions have to retain their location relative to object.
but that is not happening.
Please help me by providing a code snippet which can retain the dimension text location if the object relative to the object, is scaled or moved.
I am using VB.
Thank you.

Add features to a group

$
0
0

From a Journal found on this forum I was trying to select all extrude features in a part and put them in featuregroup.
I get the journal to create the group but the extrudes are not added to the group.

What am I doing wrong?

Thanks for your help!!

Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Features
Imports NXOpen.Utilities

Module Module1

Dim theSession As Session = Session.GetSession()
Dim lw As ListingWindow = theSession.ListingWindow
Dim ufs As UFSession = UFSession.GetUFSession()

Sub Main()

Dim toBeGrouped() As Features.Feature = getFeatures
Dim featTags(toBeGrouped.Length - 1) As Tag

For ii As Integer = 0 To toBeGrouped.Length - 1
featTags(ii) = toBeGrouped(ii).Tag

Next

Dim fGroup As Tag = Tag.Null
ufs.Modl.CreateSetOfFeature("TEST", featTags, toBeGrouped.Length, 1, fGroup)

End Sub

Function getFeatures

Dim gotFeature As ArrayList = New ArrayList
Dim feats As Features.FeatureCollection = theSession.Parts.Display.Features

For Each feat As Feature In feats
Try

if feat.FeatureType = "EXTRUDE" then
gotFeature.add(feat)
End if
Catch ex As Exception

End Try
Next

'do something with exception
return gotfeature.ToArray(GetType(Features.Feature))
End Function

Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return CType(Session.LibraryUnloadOption.Immediately, Integer)
End Function
End Module

InputBox taking a couple of seconds to disappear!

$
0
0

To all,

I am going over a "old" program and I have noticed the following issue.
I have an Inputbox, see below, to ask the user an value. It works just fine however I have noticed than once the value is entered and one presses 'OK' the Inputbox "hang a bit" i.e. remained displayed but the program carries on as intended. This means that all the messages/info written to the LW (as the program progress) are "buffeted" and almost all appears at once when the program has nearly finished. One can see that the program is writing to the LW but there is a delay

Any idea how I can fix this cosmetic issue?

Thanks
Regards
JXB

Do
	  sNmodeChoice =Inputbox("How many modes ?", "Nmode Choice", " ") 
		If sNmodeChoice =""Then
			sNmodeChoice103 ="20"
			theLW.WriteLine("")
			theLW.WriteLine("No value specified. Default to 20 modes")EndIf 
	Loop until Integer.TryParse(sNmodeChoice103,iNmodes)

Pausing a program to "interact" with user?

$
0
0

To all,

Just thinking about a possible option to a program and seeking advice. I have a program which loops through a user selection to create some results. The overall duration of the loop can be hours (last time was ~8.5hrs !). If running overnight not a big issue. While there are plenty of info being written in the LW to let the user know what is happening there is no way of stopping the program without “killing” the NX session. I am however thinking about the option of pausing the program, for a few seconds, at the end of each (main) loop to ask the user if he wants to carry on. Some web searches are pointing toward a StopWatch, see below, but as you may have guessed it, I need to interact with the user.

' Create a Stopwatch and sleep for zero milliseconds.Dim mystopwatch As Stopwatch = mystopwatch.StartNew
 Thread.Sleep(0)
 mystopwatch.Stop()' Write the current time.
 theLW.WriteLine("elapse time  1"& mystopwatch.ElapsedMilliseconds)
 theLW.WriteLine("date1 "& DateTime.Now.ToLongTimeString)

I am therefore playing with a simple function but as suspected it does not work because the Messagebox stays displayed until Yes/No is pressed. I need the messagebox to appears and automatically disappear (answer = no) after say 5 seconds

Is there a way of tackling such problem without a Windows form?

Function PauseLoop()AsBooleanDim StartTime, EndTime AsDateDim dElapseTime AsDouble=0
		PauseLoop =False 
		StartTime =NowWhile dElapsetime < 5
			EndTime =Now
			dElapseTime  = EndTime.Subtract(StartTime).TotalSeconds'Answer = 1  = Yes	Answer = 2  = NoDim answer, title, questionAsString
			title ="the title"question="Carry on with next loop?"
			answer = theUISession.NXMessageBox.Show(title, NXMessageBox.DialogType.Question, question) 
				If answer =1Then
					PauseLoop =TrueExitWhileEndif 
		EndWhile 
	EndFunction

Access

$
0
0

Hello,

I need to access a Note in a drawing, but it have a follow name: C:TC7R0.

When I use the command getstringattribute, my code don't work.

workPart.GetStringAttribute("C:TC7R0")

Anyone help me, please?

Tks in advance.

Edit attribute of all sheet body in an assembly

$
0
0

I've been trying to write a journal that searches all sheet bodies in an assembly with a specific attribute (material) and value (steel) and than changes the value of an other attribute (density).
Here is what I got so far but I really can't get it to work.
I found an example of the "setuserattribute" method on this forum but don't know how make it work for sheetbodies in stead of parts.
Any ideas?

Many thanks for your help!!

Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen

Module Module1

Sub Main()

Dim theSession As Session = Session.GetSession()
If IsNothing(theSession.Parts.BaseWork) Then
'active part required
Return
End If

Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()

Const SA_MATERIAL As String = "SA_MATERIAL"
Const A_32 As String = "A_32"
Const SA_DESITY As String = "SA_DENSITY"
Const DENSITY As String = "0"

For Each solid As Body In workPart.Bodies
If solid.HasUserAttribute(SA_MATERIAL, NXObject.AttributeType.String, A_32)
then solid.SetUserAttribute(SA_DENSITY, -1, Not (solid.SetUserAttribute(attributeName, DENSITY)), Update.Option.Now)
End If
Next

lw.Close()

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module

Attached is NX Journal/Routing Electrical to check is components are attached to the harness.

$
0
0

Attached is NX Journal/Routing Electrical to check is components are attached to the harness.
The code was sent to GM North America to check the quality of the model.

  1. Option Strict Off
  2. Imports System
  3. Imports System.Windows.Forms
  4. Imports NXOpen
  5. Imports NXOpen.UF
  6. Imports NXOpen.Assemblies
  7. Module NXJournal
  8. Public theSession As Session = Session.GetSession()
  9. Public theUFSession As UFSession = UFSession.GetUFSession()
  10. Public lw As ListingWindow = theSession.ListingWindow
  11. Dim workPart As Part = theSession.Parts.Work
  12. Dim dispPart As Part = theSession.Parts.Display
  13. Sub Main()
  14. lw.Open()
  15. Try
  16. Dim c As ComponentAssembly = dispPart.ComponentAssembly
  17. IfNot IsNothing(c.RootComponent)Then
  18. ForEach child As Component In c.RootComponent.GetChildren()
  19. child.SetAttribute("LINK", "N")
  20. Next
  21. EndIf
  22. Catch e As Exception
  23. theSession.ListingWindow.WriteLine("Failed: "& e.ToString)
  24. EndTry
  25. makeAllCompsEntirePart()
  26. loadAllRoutingControlPointsToArray_ControlPoints1()
  27. For i AsInteger=0To(ControlPoints1.length-1)
  28. componentOfRCP(ControlPoints1(i))
  29. Next
  30. lw.WriteLine("!!****************************************************")
  31. lw.WriteLine("!! For help contact Carlo Tony Daristotile LINKEDIN.")
  32. lw.WriteLine("!* <a href="mailto:cdaristotile@lear.com"> </a> / <a href="mailto:carlo.daristotile@gmail.com"> </a>")
  33. lw.WriteLine("!!****************************************************")
  34. lw.Close()
  35. EndSub
  36. '***************************************************************************
  37. '**************************************************************************
  38. ' function componentOfRCP(ControlPoint1 as NXOpen.Routing.ControlPoint) as string
  39. '
  40. ' REQUIREMENTS
  41. ' - ALL COMPONENTS ENTIRE PART
  42. ' - ALL COMPONENTS FULLY LOADED
  43. '**************************************************************************
  44. '**************************************************************************
  45. Function componentOfRCP(ByVal ControlPoint1 As NXOpen.Routing.ControlPoint)AsString
  46. componentOfRCP = ControlPoint1.name
  47. ControlPoint1.unblank()
  48. Dim rcpTag As Tag = ControlPoint1.tag
  49. Dim numOfPorts AsInteger
  50. Dim portTags()As Tag
  51. Try
  52. 'INPUT = ROUTING CONTROL POINT , OUTPUT = PORTS
  53. theUFSession.Route.AskRcpPorts(rcpTag, numOfPorts, portTags)
  54. ForEach portTag As tag In portTags
  55. Dim port_occ_tag1 As tag
  56. Try
  57. 'INPUT = EXTRACT PORT ON ROUTING , OUTPUT = FIXPORT/MUTLIPORT OF COMPONENT
  58. theUFSession.Route.AskPortOccOfPort(portTag, port_occ_tag1)
  59. If port_occ_tag1 <> tag.NullThen
  60. Dim part_occ_Tag As Tag
  61. Try
  62. 'INPUT = FIXPORT/MUTLIPORT OF COMPONENT , OUTPUT = COMPONENT
  63. theUFSession.Route.AskPortPartOcc(port_occ_tag1, part_occ_Tag)
  64. If part_occ_Tag <> tag.NullThen
  65. Dim TaggedObject1 As TaggedObject
  66. TaggedObject1 = Utilities.NXObjectManager.Get(part_occ_Tag)
  67. IfNot TaggedObject1 IsNothingThen
  68. If TaggedObject1.gettype.tostring="NXOpen.Assemblies.Component"Then
  69. Dim component1 As NXOpen.Assemblies.Component= TaggedObject1
  70. componentOfRCP = component1.name
  71. component1.SetAttribute("LINK", "YES")
  72. EndIf
  73. EndIf
  74. EndIf
  75. Catch exPoint3 As exception
  76. EndTry
  77. EndIf
  78. Catch exPoint2 As exception
  79. EndTry
  80. Next portTag
  81. Catch exPoint1 As exception
  82. EndTry
  83. Erase portTags 'free memory
  84. EndFunction
  85. '**************************************************************************
  86. '**********************************************************
  87. Dim ControlPointCollection1 As NXOpen.Routing.ControlPointCollection
  88. Dim ControlPoints1()As NXOpen.Routing.ControlPoint
  89. Sub loadAllRoutingControlPointsToArray_ControlPoints1()
  90. ' ----------------------------------------------
  91. 'load control points to array ControlPoints1()
  92. ' ----------------------------------------------
  93. REM ControlPointCollection1 = workPart.RouteManager.ControlPoints
  94. ControlPointCollection1 = dispPart.RouteManager.ControlPoints
  95. ControlPoints1 = ControlPointCollection1.ToArray()
  96. EndSub
  97. '**********************************************************
  98. '******************************************
  99. Sub makeAllCompsEntirePart()
  100. '--------------------------------------------
  101. 'make all comps Entire Part
  102. '--------------------------------------------
  103. 'REQUIREMENT
  104. 'comps DEFINED
  105. '--------------------------------------------
  106. Try
  107. Dim comps()As component = dispPart.ComponentAssembly.RootComponent.getchildren()
  108. Dim errorList2 As ErrorList
  109. errorList2 = workPart.ComponentAssembly.ReplaceReferenceSetInOwners("Entire Part", comps)
  110. 'errorList2 = workPart.ComponentAssembly.ReplaceReferenceSetInOwners("PART", comps)
  111. errorList2.Dispose()
  112. Catch ex_EntirePart As exception
  113. MessageBox.Show("Replace all REFERENCE SETS of component assembly to ENTIRE PART."& VBLF & ex_EntirePart.Message)
  114. lw.writeline("Replace all REFERENCE SETS of component assembly to ENTIRE PART."& VBLF)
  115. EndTry
  116. EndSub
  117. '******************************************
  118. '**************************************************************************
  119. PublicFunction GetUnloadOption(ByVal dummy AsString)AsInteger
  120. 'Unloads the image when the NX session terminates
  121. GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
  122. EndFunction
  123. End Module

Scale view in Drafting

$
0
0

Below journal which show the scale of view in drawings as scale factory (e.g.1, 0.5, 0.1). I would like to show scale of view as RATIO (e.g. 1:1, 2:1; 1:10 ...)

Option Strict Off 
Imports System
Imports NXOpen
 
Module Module1
 
Sub Main() 
Dim theSession As Session = Session.GetSession()If IsNothing(theSession.Parts.Work)Then'active part requiredReturnEndIf 
Dim workPart As Part = theSession.Parts.WorkDim displayPart As Part = theSession.Parts.Display 
Dim lw As ListingWindow = theSession.ListingWindow 
lw.Open()Const undoMarkName AsString="Module1"Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName) 
Dim exportScale AsStringDim ScaleNumerator AsdoubleDim ScaleDenominator asdoubleDim sheet As NXOpen.Drawings.DrawingSheet 
 
ForEach sheet In workPart.DrawingSheets 
 exportScale = sheet.GetDraftingViews(0).Style.General.Scale 
 lw.writeline(" Scale: "& exportScale)
 lw.writeline("Number of views on sheet: "& sheet.SheetDraftingViews.ToArray.Length) 
 sheet.GetScale(ScaleNumerator, ScaleDenominator)
 lw.writeline("Scale of the drawing sheet: "& ScaleNumerator &":"& ScaleDenominator) 
Next 
ForEach shtView As Drawings.DraftingView In sheet.SheetDraftingViews
	lw.WriteLine("  View name: "& shtView.Name)
	lw.WriteLine("  Method no. 2 - Scale: "& shtView.Style.General.Scale)Next 
lw.Close() 
EndSub'***********************************************************************PublicFunction GetUnloadOption(ByVal dummy AsString)AsInteger 
	'Unloads the image immediately after execution within NX
	GetUnloadOption = NXOpen.Session.LibraryUnloadOption.ImmediatelyEndFunction 
End Module 

I recorded my journal and tried something like this (according to NXOpen.Net reference guide):

For Each Scala1 As Drawings.EditViewSettingsBuilder In Drafting.SettingsManager.CreateDrawingEditViewSettingsBuilder

lw.writeline("Scala: "& Scala1.ViewStyle.ViewStyleGeneral.Scale.ScaleType.Ratio)

Next

I'm not sure how to correctly define a group "Drafting.SettingsManager.CreateDrawingEditViewSettingsBuilder()". I tried "workpart.Drafting.SettingsManager.CreateDrawingEditViewSettingsBuilder()" but I do not want to guess I would like to be aware of these.
Could You help me how to show Scale of Drafting View as Ratio?
I use NX 10

Thanks
Marcin

Powershell command white space delimiter

$
0
0

Hello,

I could need some help with the following issue:

If I write the following command into a batch file, an import into Teamcenter will start.

call C:\bin\import_file -u="u" -p="u" -g="role" -f="K:drawing.pdf" -type="pdf" -d="PDF" -ref="PDF_Reference" -de="r" -item="D" -revision="A" -ie="y"

How do I write this as Powershell-command? I tried so many different versions like shown in google, but I couldn´t get this to run.

I am just an engineer...

Best regards

Using System.Drawing.Color with NX "journal" ?

$
0
0

To all

I have a small piece of code which allocate a (pre-defined) colour for a mesh type. Nothing fancy. The colour codes and names are "hard coded", see bleo for an example. Works just fine

Case 1
 iColourCode = 181
 sColourName = "Magenta"
 
'etc
 
End Select
mesh.Color = iColourCode
theLW.WriteLine ("--Mesh Collector: " & mesh.Name & ". Displayed colour set to: " & sColourName)

I am trying to see if I could use the option System.Drawing.Color to either get the name of the colour (if I know the code) or the code If I have the colour name. I am simply trying to use existing functions/capabilities rather than hard code to many things

Does anyone know if it's possible to set that up with a NX "journal"?

Thanks
Regards

Access to multiple OP2 file without opening SIM file

$
0
0

Dear All,

Is that possible to use NX open to read and write results directly from multiple OP2 files without opening the corresponding SIM files.

Thanks and best regards,
Frank Mao

Problem with Imports System.Windows.Forms

$
0
0

Hi, I have made some journals which are using Windows Forms
and up to now they worked very well.
I believe I have had an automatically update which installed
a new Version of the Microsoft .Net Framework (> Version now is: 4.6.1).
I'm using NX9.0.3.4.
Since this Installation I'll get an error message: 'Forms' is not a member of 'Windows'.
Can anybody help me with this?
Thanks!

Need a script help to export zone location

$
0
0

Can anyone please help me out with a script to export zone location in Nx drawings for any sheet size?

Regarding Character skipping in Zone loaction for Nx Drawing

$
0
0

How to skip character letter like, we don't to print letters I, O, Q and S. and also it should pop up to ask which letters to skip.
Please help me out on this.

Regards,
Ravi


Zone values in Drawing for View Titles, Callouts and Item number Balloons

$
0
0

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.

Retrieve current work layer

$
0
0

Hi, how to retrieve the current work layer using vb .net?

Thanks

LIM
NX 10.0.3.5 MP1
WINDOWS 7

XPath Teamcenter-XML

$
0
0

Hello Gurus,

I´ve got a problem with reading a Teamcenter Xml-File via XPath.

I am not able to get the right path for following XML-Data: < > are replaced with ( and )

(TcBusinessData xmlns="http://teamcenter.com/BusinessModel/TcBusinessData" Date="")
(Add)
(TcLOV name="INDO_WL_Bemerkung" lovType="ListOfValuesString" usage="Exhaustive" description="")
(TcLOVValue value="Rilsan" description="" conditionName="isTrue"/)
(TcLOVValue value="Bronce 1" description="" conditionName="isTrue"/)
(/TcLOV)
(/Add)
(/TcBusinessData)

My Function looks like this:

Function ReadXML(XmlFile As String, Pattern As String)

Dim list As New List(Of String)

Dim Xml As New XmlDocument()
Xml.Load(XmlFile)
For Each ReadNode As XmlNode In Xml.SelectNodes_
("//TcLOV[@name="""& Pattern & """]/TcLOVValue/@value")
list.Add(ReadNode.InnerText)
Next

Return list
End Function

If I remove the part with the namespace URI

xmlns="http://teamcenter.com/BusinessModel/TcBusinessData"

erverything does work. I tried now so many different things like using the entire Path, including the attributes and namespaces etc. Could anyone tell me the right code? Seems I am too stupid...

Thank you and best regards

Balloon Information Extract

$
0
0

Hello, I´m new to NX, and new to NX Journaling (my programming abilities are mostly on embedded systems microcontrollers and PLC´s).

I need a simple program to extract balloons and notes information from a drawing, so far, I recorded a Journal. In this journal I follow the next menu path: menu>information>Object
There I apply 2 filters: type-filter where I select Notes and symbol, then I select detail filtering to only select balloons, finally I select a color filter (color #6). After the filters, I click all objects and last I proceed to extract the info (click).
The problem is I don´t know how to get rid of the selection stickiness.

I appreciate your help beforehand. And appreciate the effort you've invested to crate and maintaining this community.

Here is the recorded Code (I've deleted sticky objects that where created except the first two and the last ones).

 NX 10.0.3.5
 
 
Option Strict Off
Imports System
Imports NXOpen
 
Module NXJournal
Sub Main (ByVal args() As String) 
 
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
 
Dim displayPart As NXOpen.Part = theSession.Parts.Display
 
' ----------------------------------------------
'   Menu: Information->Object...
' ----------------------------------------------
Dim markId1 As NXOpen.Session.UndoMarkId
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Start")
 
theSession.SetUndoMarkName(markId1, "Class Selection Dialog")
 
' ----------------------------------------------
'   Dialog Begin Select by Type
' ----------------------------------------------
' ----------------------------------------------
'   Dialog Begin Symbol
' ----------------------------------------------
' ----------------------------------------------
'   Dialog Begin Select by Type
' ----------------------------------------------
' ----------------------------------------------
'   Dialog Begin Color
' ----------------------------------------------
' Refer to the sample NXOpen application, Selection for "Select All" alternatives.
Dim markId2 As NXOpen.Session.UndoMarkId
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Class Selection")
 
theSession.DeleteUndoMark(markId2, Nothing)
 
Dim markId3 As NXOpen.Session.UndoMarkId
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Class Selection")
 
theSession.DeleteUndoMark(markId3, Nothing)
 
theSession.SetUndoMarkName(markId1, "Class Selection")
 
theSession.DeleteUndoMark(markId1, Nothing)
 
Dim selectedObjects1(84) As NXOpen.NXObject
Dim note1 As NXOpen.Annotations.Note = CType(workPart.FindObject("HANDLE R-XXXXXXX"), NXOpen.Annotations.Note)
 
selectedObjects1(0) = note1
Dim note2 As NXOpen.Annotations.Note = CType(workPart.FindObject("HANDLE R-XXXXXXXX"), NXOpen.Annotations.Note)
 
 
selectedObjects1(11) = note12
Dim idSymbol1 As NXOpen.Annotations.IdSymbol = CType(workPart.FindObject("HANDLE R-XXXXXXXX"), NXOpen.Annotations.IdSymbol)
 
 
selectedObjects1(84) = note77
theSession.Information.DisplayObjectsDetails(selectedObjects1)
 
' ----------------------------------------------
'   Menu: Edit->Undo List->1 Enter Drafting
' ----------------------------------------------
Dim marksRecycled1 As Boolean
Dim undoUnavailable1 As Boolean
theSession.UndoLastNVisibleMarks(1, marksRecycled1, undoUnavailable1)
 
' ----------------------------------------------
'   Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
 
End Sub
End Module

Performance Issues using .With structure?

$
0
0

I am only curious, but generally speaking has anybody any knowledge on performance differences when using the with structure compared to accessing an objects properties directly?

I would think that the compiler would treat both segments of code equally? I typically use the with structure to access an objects properties because it is visually more appealing.

Viewing all 67 articles
Browse latest View live