ilogic Rename Browser Name

ilogic Rename Browser Name

ThomasCassan
Enthusiast Enthusiast
1,546 Views
9 Replies
Message 1 of 10

ilogic Rename Browser Name

ThomasCassan
Enthusiast
Enthusiast

Hi Guys

 

i have a little problem

i am using a small ilogic rule to rename the browser title of every part or assembly

 

'Funktion des iTriggerknopfes aktivieren
trigger = iTrigger0
'Displayname ändern
strText = iProperties.Value("Project", "Part Number") & "-" & iProperties.Value("Summary", "Title")
'Mshbox, damit gewartet wird
'MsgBox ("Warte auf OK!")

'Prüfen, ob Displayname überschrieben wurde
If ThisDoc.Document.DisplayNameOverridden = True Then
	MsgBox ("Displayname überschrieben:" & ThisDoc.Document.DisplayName)
End If

 

It works perfect with part and assembly, but not with a sheet metal part - the message box shows the right value but in the browser its still the old name. Is there something special with the sheet metal part related to the normal volume parts???

 

Thx for your support!!

 

Cheers

Tom

0 Likes
1,547 Views
9 Replies
Replies (9)
Message 2 of 10

WCrihfield
Mentor
Mentor

Nothing that specaial about Sheet Metal Parts, as far as iProperties are concerned.

The Part Numbe iProperty isn't always necessarily the same as the Document.DisplayName.  You can change the Part Number iProperty, and it won't change the document's DisplayName.  The DisplayName, generally comes from the file name, unless changed somehow within the document, after the fact.

How are you specifying the Part Number within your Title Block Definition?  Is it an inserted live iProperty, or is it a Prompted Attribute, or other form?  If it is an inserted live iProperty, is it the Part Number of the Drawing Document, or of the Model Document?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 10

ThomasCassan
Enthusiast
Enthusiast

The propterty of the part number is normaly the filename - but we have a lot of old files - so the part number is different. but we always are using the same fild in the part/assembly iProperty Structure - and this is what you see in the header of the drawing.

but - why does it work with a normal part to rename it but not with a sheet metal part? wired stuff.....  😉

0 Likes
Message 4 of 10

Martin-Winkler-Consulting
Advisor
Advisor

@ThomasCassan 

Could you please upload the complete code how the renaming is done?

The code you have posted only shows a control mechanism wether the Part Number was changed.

 

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

0 Likes
Message 5 of 10

Darkforce_the_ilogic_guy
Advisor
Advisor

I am not sure I understand your problem 

 

the code to add does not rename anything as far as I can see.

 

 

do you want to rename the browser note to ? or do you simple want to remove the override. So that it show the file name(part.ipt/assambly.iam) as it normal do ... or that do you want .. I might already have a code you can use .. but it depant of what your want the browser name  to be change to

0 Likes
Message 6 of 10

ThomasCassan
Enthusiast
Enthusiast

The compolete code is in the first message here.

What I want is to rename the name of the part in the browser

mech2_0-1586963074061.png

there is also a function in Inventor to rename the browser name - it´s also not working with sheet metal parts.

mech2_1-1586963234869.png

 

thx for all your support!!!

cheers

Tom

 

0 Likes
Message 7 of 10

Martin-Winkler-Consulting
Advisor
Advisor

@ThomasCassan 

'Displayname ändern
strText = iProperties.Value("Project", "Part Number") & "-" & iProperties.Value("Summary", "Title")

This part of the rule changes nothing. It only creates a variabel strText with the content right from the equal sign.

There has to be other code.

Where is the start point of the rule? In an assembly?

 

There are various options for renaming the browser nodes. Keep in mind that renaming means that the file name will no longer be set automatically later in the browser.

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

0 Likes
Message 8 of 10

ThomasCassan
Enthusiast
Enthusiast

Sorry man..... heres the total code

'Funktion des iTriggerknopfes aktivieren
trigger = iTrigger0
'Displayname ändern
strText = iProperties.Value("Project", "Part Number") & "-" & iProperties.Value("Summary", "Title")
'Mshbox, damit gewartet wird
'MsgBox ("Warte auf OK!")

'Prüfen, ob Displayname überschrieben wurde
'If ThisDoc.Document.DisplayNameOverridden = True Then
'	MsgBox ("Displayname überschrieben:" & ThisDoc.Document.DisplayName)
'End If

mech2_0-1586967112151.png

 

Message 9 of 10

Martin-Winkler-Consulting
Advisor
Advisor

@ThomasCassan 

Here are 2 rules for you:

1. changes the display to "test"

 

Sub Main()
	Dim oPart As PartDocument = ThisDoc.Document
	Dim strText As String = "Test"
	oPart.DisplayName = strText
	
	If oPart.DisplayNameOverridden Then
		MsgBox("DisplayName overwritten with " & strText,vbOKOnly,"Display Name")
	End If
End Sub

 

2. changes it back to orginal not overwritten status

 

Sub Main()
	Dim oPart As PartDocument = ThisDoc.Document
	oPart.DisplayName = ""
	If oPart.DisplayNameOverridden = False Then
		MsgBox("Display Name original",vbOKOnly,"Display Name")
	End If
End Sub

 

I tested both rules in a sheet metal part and it works.

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

0 Likes
Message 10 of 10

ThomasCassan
Enthusiast
Enthusiast

Hi Martin

 

thx for your effort - i appreciate it a lot!!

but there must be something wrong with my installation here - both rules does not work.

Using my rule by activating the message box i see that the value is changed - but you can not see it in inventor. The same on your rules. I see there is a change - but nothing happend in Inventor.

Its just a Diva...   🙂

 

i will go on with repair the installation and take a look again.

 

Thx so far

Tom

0 Likes