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

compilation iproperties in assemblies

  • Thread starter Thread starter zsolt
  • Start date Start date

zsolt

Guest
Hello.
my name is zsolt and sn new in this forum. I am 24 years old and work for a company that produces plants for aviculture. I have come here to ask you for help on a matter that worries me for a long time.
I have created a global ilogic module in inventor that using external rules and relying on an external excel file, compile different fields of iproperties automatically by clicking a button of this form. works perfectly, in single parts *.ipt. My problem is as follows:
I would like to make a form that also works for the assemblies and that automatically went to compile all the properties of the individual pieces present in a set. I do not know however how it would behave with the parts of the library, because those iproperties have already compiled them, so they would be excluded, or we can rename them and then they will not be saved!? ! ?

I hope some of you can help me out. Meanwhile I place you but external rule that compiles the iproperties of a single part, in practice I would like this to be repeated for each part of the whole (-freedom? ? ):
i = goexcel.findrow("z:\disegni_inventor\descrizioni.xlsx", "valli_articoli-e-traduzioni", "code article", "=", iproperties.value ("project", "part number")
iproperties.value ("project", "description") = goexcel.currentrowvalue("descr. Article")
iproperties.value ("custom", "descr. agg. ita") = goexcel.currentrowvalue("descr.agg. Article")
iproperties.value ("project", "project") = goexcel.currentrowvalue("group membership")
iproperties.value ("custom", "English description") = goexcel.currentrowvalue("descr.transduced")
iproperties.value ("custom", "descr. agg. eng") = goexcel.currentrowvalue("descr.agg.transduced")
 
here you find the code in visualbasic to pass all the elements of a set, ilogic I don't know it and I don't know if you can carry (use recursive code) but I think it's worth trying.

f1 -> programming guide (bees) -> cut-and-paste sample code -> bills of materials
I don't know how to tell you now, maybe if I have time to test...

Bye!
 
f1 -> programming guide (bees) -> cut-and-paste sample code -> bills of materials
I don't know how to tell you now, maybe if I have time to test...
Sorry ignorance but I can't find it!! :cool:
with f1 opens the guide online....

regarding the elements of the library I don't think there may be problems since they are only reading, so the module could quietly fill out all the iproperties as well as those of the library are not saved.

If you can post that code first, I'd be grateful.

p.s., however, looking at the stubborn components of a set, it would be enough to fill out the iproperties of all the components of the structure that do not have the structure distinct components equal to purchased, that is, those of the library.
 
f1 di inventor dalla finestra modellazione, io uso i2011

comunque:
public sub bomquery()
' set a reference to the assembly document.
' this assumes an assembly document is active.
dim odoc as assemblydocument
set odoc = thisapplication.activedocument

dim firstlevelonly as boolean
if msgbox("first level only?", vbyesno) = vbyes then
firstlevelonly = true
else
firstlevelonly = false
end if

' set a reference to the bom
dim obom as bom
set obom = odoc.componentdefinition.bom

' set whether first level only or all levels.
if firstlevelonly then
obom.structuredviewfirstlevelonly = true
else
obom.structuredviewfirstlevelonly = false
end if

' make sure that the structured view is enabled.
obom.structuredviewenabled = true

'set a reference to the "structured" bomview
dim obomview as bomview
set obomview = obom.bomviews.item("structured")

debug.print "item"; tab(15); "quantity"; tab(30); "part number"; tab(70); "description"
debug.print "----------------------------------------------------------------------------------"

'initialize the tab for itemnumber
dim itemtab as long
itemtab = -3
call querybomrowproperties(obomview.bomrows, itemtab)
end sub

private sub querybomrowproperties(obomrows as bomrowsenumerator, itemtab as long)
itemtab = itemtab + 3
' iterate through the contents of the bom rows.
dim i as long
for i = 1 to obomrows.count
' get the current row.
dim orow as bomrow
set orow = obomrows.item(i)

'set a reference to the primary componentdefinition of the row
dim ocompdef as componentdefinition
set ocompdef = orow.componentdefinitions.item(1)

dim opartnumproperty as property
dim odescripproperty as property

if typeof ocompdef is virtualcomponentdefinition then

'get the file property that contains the "part number"
'the file property is obtained from the virtual component definition
set opartnumproperty = ocompdef.propertysets _
.item("design tracking properties").item("part number")

'get the file property that contains the "description"
set odescripproperty = ocompdef.propertysets _
.item("design tracking properties").item("description")

debug.print tab(itemtab); orow.itemnumber; tab(17); orow.itemquantity; tab(30); _
opartnumproperty.value; tab(70); odescripproperty.value
else

'get the file property that contains the "part number"
'the file property is obtained from the parent
'document of the associated componentdefinition.
set opartnumproperty = ocompdef.document.propertysets _
.item("design tracking properties").item("part number")

'get the file property that contains the "description"
set odescripproperty = ocompdef.document.propertysets _
.item("design tracking properties").item("description")

debug.print tab(itemtab); orow.itemnumber; tab(17); orow.itemquantity; tab(30); _
opartnumproperty.value; tab(70); odescripproperty.value

'recursively iterate child rows if present.
if not orow.childrows is nothing then
call querybomrowproperties(orow.childrows, itemtab)
end if
end if
next
itemtab = itemtab - 3
end sub
 
thanks now I try to study it a bit and see if I can handle it in vb even if I prefer the external rules of ilogic so the external module would already be available to all users of the network. if you have other suggestions I thank you in advance. :wink:
 
for now I have managed to make it go in vb, it works (not from mistakes), but I absolutely do not know what it does, since I do not see any kind of changes! :frown: and then I don't know how to connect my excel file where it has to give to read iproperties and compile them.
 
Well, it doesn't make any changes, reads iproperties and videos; was just an example of how to scroll the various components of a set.
 
aaaaaahh oook seen :-d but how do I tell him, that he perm every component must go to compile certain iproperties using the code that I have?? ?
 
the idea is that you see how the macro works with regard to the search for assemblies and subaxis and parts components and try to bring it back to ilogic... you can also do the reverse but it is more laborious if you don't practice, especially taking the data from excel.
 

Forum statistics

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

Members online

No members online now.
Back
Top