Logic to match Inventor file names to the search engine names

Logic to match Inventor file names to the search engine names

이스리
Explorer Explorer
96 Views
3 Replies
Message 1 of 4

Logic to match Inventor file names to the search engine names

이스리
Explorer
Explorer

Hello.

Is there an iLogic function that converts Inventor file names to the file names in the browser tree?

There's logic to match part numbers to file names,

but I don't see any logic to match file names to the file names in the browser tree.

0 Likes
97 Views
3 Replies
Replies (3)
Message 2 of 4

marcin_otręba
Advisor
Advisor

Check this thread:

 

Re: is there a way to find all Browser notes that does not show the partnumber ? - Autodesk Communit...

 

you can use inventor built in functionality as described in that thread or use ilogic with some adjustments..

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 3 of 4

이스리
Explorer
Explorer

Hello.

The file name and the tree name are different, so I can't use the Rename Search Node feature.

I've renamed information like materials in the tree.

So, I want to change the Inventor file name to the tree name.

0 Likes
Message 4 of 4

marcin_otręba
Advisor
Advisor

ok i understand..

 

try:

it will safe &replace all first level occ in current assembly wchich file  name is not equal to occurrence name.

 

Dim ass As AssemblyDocument = ThisDoc.Document
For Each occ As ComponentOccurrence In ass.ComponentDefinition.Occurrences
	If occ.Suppressed Then Continue For
	If TypeOf occ.Definition Is VirtualComponentDefinition Then Continue For
	Dim occ_name As String = ""
	occ_name = Split(occ.Name, ":")(0)
	Dim full_filename As String = ""
	full_filename=occ.Definition.Document.fullfilename
	Dim path As String = ""
	path=Microsoft.VisualBasic.left(full_filename, InStrRev(full_filename, "\", -1))
    Dim file_name As String = ""
	file_name=Microsoft.VisualBasic.Right(full_filename, Len(full_filename) -InStrRev(full_filename, "\", -1))
	Dim ext As String = ""
	ext = Microsoft.VisualBasic.Right(full_filename, 4)
	file_name = Split(file_name, ".")(0)
		
	If file_name.ToLower <> occ_name.ToLower Then
	
	Dim doc As Document = occ.Definition.Document
	Logger.Info(path & "  " & file_name & "  " & occ_name)
	If Dir(path & occ_name & ext) = "" Then
		Try
		doc.SaveAs(path & occ_name & ext, True)
		Catch ex As Exception
		End Try
	End If
		Try
		occ.Replace(path & occ_name & ext,True)
		Catch ex As Exception
		End Try
	
	
	End If
Next

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes