• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

change fields in the browser

  • Thread starter Thread starter mir
  • Start date Start date

mir

Guest
Hi.
how can you change the data that is displayed in your browser ... besides the name I mean?

Thank you.
 
Hi.
how can you change the data that is displayed in your browser ... besides the name I mean?

Thank you.


ho trovato questo ilogic, rinomina il browser mettendo il n° parte + descrizione

sembra funzionare

sub main
dim asmdoc as assemblydocument
asmdoc = thisapplication.activedocument
shortname=thisdoc.filename(false) 'with extension (false) without extension

' change the name for the assembly.
asmdoc.displayname = buildname(asmdoc)

' change the name in every referenced document.
dim doc as document
for each doc in asmdoc.allreferenceddocuments
oorigrefname = doc.fullfilename

fnamepos = instrrev(oorigrefname, "", -1)'find the postion of the last backslash in the path
name = right(oorigrefname, len(oorigrefname) - fnamepos)'get the file name with the file extension
shortname = left(name, len(name) - 4)'get the file name (without extension)
iproperties.value(name, "project", "part number")=shortname'scrive sul numero parte il nome del file
doc.displayname = buildname(doc)
next
end sub


private function buildname(doc as document) as string

dim new_name as string
dim designtrackprops as propertyset
designtrackprops = doc.propertysets.item("design tracking properties")

new_name = designtrackprops.item("part number").value & " - " & _
designtrackprops.item("description").value

' new_name = designtrackprops.item("part number").value


buildname = new_name
end function
 
hi I tried it in a set:
system.argumentexception: the 'length' argument must be greater or equal to zero.
in microsoft.visualbasic.strings.left(string str, int32 length)
in lmirulescript.main()
in autodesk.ilogic.exec.appdomexec.execruleinassembly(assembly assem)
in ilogic.ruleevalcontainer.execruleeval(string execrule)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

error in the rule: rule0, document: xxxx.iam

the 'length' argument must be greater or equal to zero.
Where am I wrong?
 
Sorry I'm prevented:
sub main
.............
iproperties.value(name, "project", "barcode")=shortname'scrive sul numero parte il nome del file
doc.displayname = buildname(doc)
next
end sub


private function buildname(doc as document) as string

dim new_name as string
dim designtrackprops as propertyset
designtrackprops = doc.propertysets.item("design tracking properties")

new_name = designtrackprops.item("barcode").value & " - " & _
designtrackprops.item("descr_partel1").value

' new_name = designtrackprops.item("part number").value


buildname = new_name
end function
Where am I wrong?
 
here is the sequence

fill out your custom iproperties fields
barcode and descr_partel1
I usually make separate components to exploit copy/paste between the values of the various parts
iproperties personalizzate.webprun the attached ilogic command (download it since I made changes)
_foto__055.webpcan restore values using the rename command from the "productivity" menu
_foto__056.webp
 

Attachments

I put on a

messagebox.show(designtrackprops.item("part number").value)

both standard and customized iproperties: I see them all appear correct but nothing changes in the browser.

ps: When you say you run the ilogic you want to create a rule with the code and execute it, don't you? !

Thank you.

ps2: Is there an ilogic manual?
 
ho trovato questo ilogic, rinomina il browser mettendo il n° parte + descrizione

sembra funzionare

sub main
dim asmdoc as assemblydocument
asmdoc = thisapplication.activedocument
shortname=thisdoc.filename(false) 'with extension (false) without extension

' change the name for the assembly.
asmdoc.displayname = buildname(asmdoc)

' change the name in every referenced document.
dim doc as document
for each doc in asmdoc.allreferenceddocuments
oorigrefname = doc.fullfilename

fnamepos = instrrev(oorigrefname, "", -1)'find the postion of the last backslash in the path
name = right(oorigrefname, len(oorigrefname) - fnamepos)'get the file name with the file extension
shortname = left(name, len(name) - 4)'get the file name (without extension)
iproperties.value(name, "project", "part number")=shortname'scrive sul numero parte il nome del file
doc.displayname = buildname(doc)
next
end sub


private function buildname(doc as document) as string

dim new_name as string
dim designtrackprops as propertyset
designtrackprops = doc.propertysets.item("design tracking properties")

new_name = designtrackprops.item("part number").value & " - " & _
designtrackprops.item("description").value

' new_name = designtrackprops.item("part number").value


buildname = new_name
end function
Good man,
using this code, with the fields "number part" and "description" compiled, modifies the wording of the asses as I would like, but does not do it with the parts below.
Where's the hippo?
use currently inventor 2017
 
You must omit this command line by adding the apex in front of asm.... .
' change the name for the assembly.
' asmdoc.displayname = buildname(asmdoc)


Hi.
 
hi I tried it in a set:



Where am I wrong?
You must omit this command line by adding the apex in front of asm.... .
' change the name for the assembly.
' asmdoc.displayname = buildname(asmdoc)


Hi.
Hello, and thank you for the answer.
if I comment the line gives me the same error as the other mentioned post, i.e. problems with lenght.
I probably didn't explain well, I would like that in the browser they would definitely appear on the children "number part" - "description", but if it also appears on the father does not change anything.

Thank you.
 
I solved this way
'********************'rinomina browser
'********************


public sub cambia_nodo()
dim asmdoc as assemblydocument
set asmdoc = thisapplication.activedocument

' change the name for the assembly.
asmdoc.displayname = buildname(asmdoc)

' change the name in every referenced document.
dim doc as document
for each doc in asmdoc.allreferenceddocuments
doc.displayname = buildname(doc)
next
end sub


private function buildname(doc as document) as string
dim name as string
dim designtrackprops as propertyset
set designtrackprops = doc.propertysets.item("design tracking properties")

name = designtrackprops.item("part number").value & " - " & _
designtrackprops.item("description").value

buildname = name
end function
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top