Journal exporting part files
Journal exporting part files
(OP)
I am in search of vb code to finish a journal I am creating to seek out and export certain parts in an assembly. I can figure out how to find said parts but am stumped on to to actually export them out. I would like to specify the part be placed in given folder for all assemblies and would name it after the assembly, without parameters as well. Any ideas? All input is well appreciated.





RE: Journal exporting part files
You can also specify different extensions (.stp, .igs, etc) and NX will translate them. As far as removing the parameters... don't know. I was working on a similar function before to export certain components of an assembly as step files but couldn't get the step exporter properties to apply correctly.
RE: Journal exporting part files
www.nxjournaling.com
RE: Journal exporting part files
RE: Journal exporting part files
CODE
www.nxjournaling.com
RE: Journal exporting part files
RE: Journal exporting part files
Yes.
Below is a bare bones journal to do just that. You'll want to add some error checking or possibly a file select dialog as needed, but this should get you started.
CODE
www.nxjournaling.com
RE: Journal exporting part files
Is there a better way to get the folder name that the file is in than what I have here?
'***********************************************************************
Function GetFilePath2()
Dim strPath as String
Dim strPart as String
Dim strPart2 as String
Dim pos as Integer
Dim pos2 as Integer
'get the full file path
strPart2 = displayPart.fullpath
pos = InStrRev(strPart2, "\")
strPart2 = Left(strPart2, pos -1)
strPath = strPart2
pos2 = InStrRev(strPath, "\")
strPart = Mid(strPath, pos2 + 1)
strPath = Left(strPath, pos)
strPart = Left(strPart, Len(strPart))
GetFilePath2 = strPart
End Function
'***********************************************************************
RE: Journal exporting part files
CODE
www.nxjournaling.com
RE: Journal exporting part files
is there a way to process an assembly file and export all parts that have an attribute that equals a defined string.
Say, export out a .prt with all components that have a catalog attribute that equals "Outside_Work"?
My best swing at it was attempting to compile a list of objects where the attributed equaled "Outside_Work" but I am stuck on how to call out the attribute of each part individually.
Denis Huskic
Data Prep
Kettering University
Class of '17
RE: Journal exporting part files
www.nxjournaling.com
RE: Journal exporting part files
Denis Huskic
Data Prep
Kettering University
Class of '17
RE: Journal exporting part files
www.nxjournaling.com
RE: Journal exporting part files
CODE --> vb
Here is what I have been trying.
CODE --> vb
Denis Huskic
Data Prep
Kettering University
Class of '17
RE: Journal exporting part files
CODE
comp.GetChildren() will return nothing because the comp variable has been created but doesn't yet contain anything.
For some working code to walk through an assembly along with explanation, see: http://nxjournaling.com/?q=content/creating-subrou...
www.nxjournaling.com