and
Guest
Is there a way to find all the .ipts that are labeled as "hidden"?
Of course, if you're making demands of this guy, you must have a nice mix of the technical archive. .and if one wants to shake ilogic?
since the aid has more than 2000 components!!
dim oassy as assemblydocument = thisdoc.document
dim opart as partdocument
dim osubdoc as document
for each osubdoc in oassy.allreferenceddocuments
if osubdoc.documenttype = inventor.documenttypeenum.kpartdocumentobject then
opart = osubdoc
' ogni bomstructure ha un valore diverso
' nascosto = 51971
messagebox.show(opart.displayname & " " & opart.componentdefinition.bomstructure)
end if
next
and possible a list... and not a message every part found!Something like that
Code:dim oassy as assemblydocument = thisdoc.document dim opart as partdocument dim osubdoc as document for each osubdoc in oassy.allreferenceddocuments if osubdoc.documenttype = inventor.documenttypeenum.kpartdocumentobject then opart = osubdoc ' ogni bomstructure ha un valore diverso ' nascosto = 51971 messagebox.show(opart.displayname & " " & opart.componentdefinition.bomstructure) end if next
Yes.and possible a list... and not a message every part found!
Sorry, you're perfectly right.Yes.
if instead the question is: "Someone makes me the piece of code? ":
- as far as I am concerned, see answer above
- He explains right away what you want so that those who decide to engage in things don't find themselves doing things again. . .
- the answer of peppe for a job once in a while is absolutely functional, otherwise you return to point 2)
if thisapplication.activedocumenttype = kassemblydocumentobject and thisapplication.activedocument.allreferenceddocuments.count > 0 then
dim lista as string
dim oass as assemblydocument = thisdoc.document
for each odoc as document in oass.referenceddocuments
if odoc.documenttype = kpartdocumentobject and odoc.componentdefinition.bomstructure = inventor.bomstructureenum.kphantombomstructure then
lista = lista & vblf & odoc.displayname & " ||--->> " & odoc.referencingdocuments(1).fullfilename
end if
next
messagebox.show(lista,"lista")
else
messagebox.show("devi essere in un assieme per esportare la lista materiali (bom)", "ilogic export")
end if
where I'm wrong... that only an empty window appears to me with "list" and "ok" button... but nothing happens?@and as you asked made a small, very limited modification to the code written by @catcher to view the full list in the dialog box.
If the list is very long, with a small change of code, I suggest you save it in a csv or text file.Code:if thisapplication.activedocumenttype = kassemblydocumentobject and thisapplication.activedocument.allreferenceddocuments.count > 0 then dim lista as string dim oass as assemblydocument = thisdoc.document for each odoc as document in oass.referenceddocuments if odoc.documenttype = kpartdocumentobject and odoc.componentdefinition.bomstructure = inventor.bomstructureenum.kphantombomstructure then lista = lista & vblf & odoc.displayname & " ||--->> " & odoc.referencingdocuments(1).fullfilename end if next messagebox.show(lista,"lista") else messagebox.show("devi essere in un assieme per esportare la lista materiali (bom)", "ilogic export") end if
' autore : rossano praderi
' creato : 02/03/2024
' modificato : 04/03/2024
const sepdisplay = " ||--->> "
const sepfile = ";"
if thisapplication.activedocumenttype = kassemblydocumentobject and thisapplication.activedocument.allreferenceddocuments.count > 0 then
dim lista as string
dim oass as assemblydocument = thisdoc.document
for each odoc as document in oass.allreferenceddocuments
if odoc.documenttype = kpartdocumentobject and odoc.componentdefinition.bomstructure = inventor.bomstructureenum.kphantombomstructure then
lista = lista & vblf & odoc.displayname & sepdisplay & odoc.referencingdocuments(1).fullfilename
end if
next
messagebox.show(lista,"lista")
if lista.length > 0 then
' attenzione!!! non viene eseguito nessun controllo degli errori e il file originale (.csv) viene sempre sovrascritto
lista = "nome;cartella padre" & vblf & lista.replace(sepdisplay,sepfile).trim() ' aggiunta intestazioni
microsoft.visualbasic.fileio.filesystem.writealltext(thisdoc.pathandfilename(false) & ".csv", lista, false)
end if
else
messagebox.show("devi essere in un assieme per esportare la lista materiali (bom)", "ilogic export")
end if
But how do I save the excel file? ? ?Because it's simple this time... .
Code:' autore : rossano praderi ' creato : 02/03/2024 ' modificato : 04/03/2024 const sepdisplay = " ||--->> " const sepfile = ";" if thisapplication.activedocumenttype = kassemblydocumentobject and thisapplication.activedocument.allreferenceddocuments.count > 0 then dim lista as string dim oass as assemblydocument = thisdoc.document for each odoc as document in oass.allreferenceddocuments if odoc.documenttype = kpartdocumentobject and odoc.componentdefinition.bomstructure = inventor.bomstructureenum.kphantombomstructure then lista = lista & vblf & odoc.displayname & sepdisplay & odoc.referencingdocuments(1).fullfilename end if next messagebox.show(lista,"lista") if lista.length > 0 then ' attenzione!!! non viene eseguito nessun controllo degli errori e il file originale (.csv) viene sempre sovrascritto lista = "nome;cartella padre" & vblf & lista.replace(sepdisplay,sepfile).trim() ' aggiunta intestazioni microsoft.visualbasic.fileio.filesystem.writealltext(thisdoc.pathandfilename(false) & ".csv", lista, false) end if else messagebox.show("devi essere in un assieme per esportare la lista materiali (bom)", "ilogic export") end if
today gives me this mistake on a group:code creates a file. csv in the active document folder, with the same active document name but with extension.csv
try opening the file with excel.