Submitted by Guljar14 on Sun, 03/20/2016 - 23:40
Forums:
Hi all,
Is there any Code available to Copy Selected component name to clipboard from properties > General tab,.....
NX 10.0.1.4
Hi all,
Is there any Code available to Copy Selected component name to clipboard from properties > General tab,.....
NX 10.0.1.4
re: component name to clipboard
The code below copies the selected component's name to the clipboard. If multiple components are selected, only the name of the first one is copied.
Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpenUI
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI
If IsNothing(theSession.Parts.BaseWork) Then
'active part required
Return
End If
Dim numsel As Integer = theUI.SelectionManager.GetNumSelectedObjects()
Dim theComps As New List(Of Assemblies.Component)
For i As Integer = 0 To numsel - 1
Dim selObj As TaggedObject = theUI.SelectionManager.GetSelectedTaggedObject(i)
If TypeOf (selObj) Is Assemblies.Component Then
theComps.Add(selObj)
End If
Next
If theComps.Count = 0 Then
'no components found among the preselected objects
Return
End If
My.Computer.Clipboard.SetText(theComps.Item(0).Name)
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
Hi.....Journal working very
Hi.....Journal working very well as I wanted...please help me in yhis problem also
I want to create a center mark using angle from selected line or axis,
Please help me how....
-[]-
re: create center mark
You want to measure the angle of the line - with respect to what? the X axis?
I'm not sure how you would relate the center mark origin point to an angled line. It seems like you would need more information?
Could you describe the full work flow that you are trying to automate?
Not sure for X axis ...
Not sure for X axis ...
We use tooling holes as reference to show machining in auxiliary views,
So center mark should be parallel to that machined edge...
Its being complicated to measure that angle for every machining
for Example Catia Drafting Command "Center Line With Reference"
-[]-
re: center mark
I only rarely work with the CAM application, and I'm not familiar with Catia; could you email me a screenshot or some sort of diagram of what it is that you are after? I'm having some trouble visualizing what it is that you are describing.
info@nxjournaling.com