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

export flat pattern ilogic

  • Thread starter Thread starter Cast16
  • Start date Start date

Cast16

Guest
Hello everyone

Does anyone have a good ilogic capable of exporting the flat patterns of all the plates from together?

until today I used the pooblish tool of matprop (trial) but unfortunately yesterday decided to stop working.

exported the sheet with format: file-material-thickness-quantity-together. now export only file name.

still goes as it should only from the ipt level. I tried to contact matprop but not having paid anything dubito that give me a hand. was the most used addin every day.
 
Hello Matteo
Yes, they are as always have been...
I had updated 2 weeks ago after installing inventor 2020.
yesterday I tried everything: install-disinstall publish tool but nothing to do.. .2019-10-15 12_18_47-Autodesk Inventor Professional 2020.webp
 
Perhaps it is a limitation of the trial version, after a while it does not work anymore
I’m still using the 2013 version and it’s automatically loaded via the additional modules in all versions
 
Do you know how to get the amount out of ilogic?
rich in having an old woman. exported everything: material-thickness but not quantity
 
If I don't... .
you need to activate on tools the item "# write qty......." then in dxf options activate qty_foto__198.webp _foto__199.webp
 
if you write an old version of publishtool, activating to its option "# write qty, writes the custom iproperties of the quantity and uses it to define the file name "idvarl0001_lamiera dec. 4010_4mm____1x.dxf; If you want only qty, you can sc
Hi.
the old version do pubblishtools no longer goes with inventor2020.
I managed to put together a code:
Code:
        if thisapplication.activedocument.documenttype <> documenttypeenum.kassemblydocumentobject then
            messagebox.show("please run this rule from the assembly file.", "ilogic")
            exit sub
        end if

        'define the active document as an assembly file
        dim oasmdoc as assemblydocument = thisapplication.activedocument
        dim oassydef as assemblycomponentdefinition
oassydef = oasmdoc.componentdefinition

dim obom as bom
obom = oassydef.bom

obom.partsonlyviewenabled = true

'change item("parts only") to item(3) or your language specific description
'if you don't run inventor english
dim obomview as bomview = obom.bomviews.item("parts only")

dim obomrow as bomrow

for each obomrow in obomview.bomrows
    'set a reference to the primary componentdefinition of the row
    dim ocompdef1 as componentdefinition
    ocompdef1 = obomrow.componentdefinitions.item(1)
    
    dim compfulldocumentname as string = ocompdef1.document.fulldocumentname
    dim compfilenameonly as string
    dim index as integer = compfulldocumentname.lastindexof("\")
    
    compfilenameonly = compfulldocumentname.substring(index+1)
    
    'messagebox.show(compfilenameonly)
    
    dim qty as string
    qty = obomrow.totalquantity
    
    iproperties.value(compfilenameonly, "custom", "qty") = qty
next
      
        dim oasmname = oasmdoc.displayname.replace(".iam", "")
'get user input
rusure = messagebox.show ( _
"this will create a dxf file for all of the asembly components that are sheet metal." _
&         vblf & "this rule expects that the part file is saved." _
&         vblf & " " _
&         vblf & "are you sure you want to create dxf for all of the assembly components?" _
&         vblf & "this could take a while.", "ilogic - batch output dxfs ",messageboxbuttons.yesno)
if rusure = vbno then
return

end if
opath = thisdoc.path
odatamedium = thisapplication.transientobjects.createdatamedium
ocontext = thisapplication.transientobjects.createtranslationcontext
ocontext.type = iomechanismenum.kfilebrowseiomechanism
ooptions = thisapplication.transientobjects.createnamevaluemap
'get dxf target folder path
ofolder = opath & "\" & oasmname & " - laser"
'check for the dxf folder and create it if it does not exist
if not system.io.directory.exists(ofolder) then
system.io.directory.createdirectory(ofolder)
end if
'-          - - - - - - - - - - - -component - - - - - - - - - - - -
'look at the files referenced by the assembly
dim orefdocs as documentsenumerator
orefdocs = oasmdoc.allreferenceddocuments
dim orefdoc as document
'work the the drawing files for the referenced models
'this expects that the model has been saved
for each orefdoc in orefdocs
iptpathname = left(orefdoc.fulldocumentname, len(orefdoc.fulldocumentname) - 3)& "ipt"
'check that model is saved
if(system.io.file.exists(iptpathname)) then
dim odrawdoc as partdocument
odrawdoc = thisapplication.documents.open(iptpathname, false)
ofilename = left(orefdoc.displayname, len(orefdoc.displayname))
ofilename1 = orefdoc.displayname.replace(".ipt", "")
dim ocompdef as sheetmetalcomponentdefinition = odrawdoc.componentdefinition
try
'set the dxf target file name
try
customname =iproperties.value(ofilename, "custom", "qty")
catch
customname ="xxx" 'wert, wenn ipropertie pf_prt_znr nicht existiert
end try
dim material as string = orefdoc.activematerial.displayname
othickness = orefdoc.componentdefinition.thickness.value*10


 
odatamedium.filename = ofolder & "\" & ofilename1 & " - " & material & " "& othickness  &"mm -  " & customname  & " off.dxf"
 

ocompdef = odrawdoc.componentdefinition

dim sout as string
sout = "flat pattern dxf?acadversion=2004&outerprofilelayer=iv_outer_pr?ofile"
ocompdef.dataio.writedatatofile( sout, odatamedium.filename)

ocompdef.flatpattern.exitedit
catch
end try
odrawdoc.close
else
end if
next
That's good enough. I just want to set the dxf layers as you do via the ini file. For example, I would like sketches to be yellow layer, yellow color. You know how to do that?
 
Bye to all,
I managed to find the solution. you have to replace the final part of the code with this:
Code:
ocompdef = odrawdoc.componentdefinition

dim optionlist as list(of string) = new list(of string)()

optionlist.add("acadversion=2004")
optionlist.add("outerprofilelayer=0")
optionlist.add("interiorprofileslayer=0")
optionlist.add("unconsumedsketcheslayer=yellow")
optionlist.add("unconsumedsketcheslayercolor=255;255;0") 'here i make the unconsumedsketcheslayer lines red!
optionlist.add("") 'you can add other options here
optionlist.add("") 'and more options
' if you want you can add more lines for more options

dim sout as string
sout = "flat pattern dxf?acadversion=2000" _
+ "&invisiblelayers=iv_tangent;iv_feature_profiles_down;iv_arc_centers;iv_bend;iv_bend_down;iv_tool_center;iv_tool_center_down;iv_feature_profiles;    iv_feature_profiles_down"

 
for each opt in optionlist
    sout = sout & "&" & opt
next
sout = sout & "?ofile"
ocompdef.dataio.writedatatofile( sout, odatamedium.filename)

ocompdef.flatpattern.exitedit
catch
end try
odrawdoc.close
else
end if
next
thanks matteo for the support.
 
Hello, Sergio.
Welcome to this forum.
I followed your comments in the forum in English and I am convinced you can contribute a lot.
I was almost asking to look at this post to ask you how to improve my ilogic rule, but too being an employee without a chance to decide where to spend money, I was hoping for a free solution.
 
since it is sheet metal parts, the quantity problem is simpler, you just need to search in the distinct components "onlyparts" and copy the quantity.
what I share below is a code that I prepare for a person.
can definitely give you an idea of how to solve your problem.
I understand you very well, I'm also an employee. I have entered this forum and others, because maybe next year I will have to settle for your continent, for reasons of family grouping, and I must prepare for change, I would like to meet people and give you my support, maybe I need yours in a future
I know that the employment situation is difficult all over the world.
I send my best greetings to you and the people of the forum.







sub main()

'[-------Create the folder inside the project folder called DXF Files
Dim oProject As DesignProject = ThisApplication.DesignProjectManager.ActiveDesignProject
Dim oProjectPath As String = Left(oProject.FullFileName, (InStrRev(oProject.FullFileName, "\", - 1, vbTextCompare)))
Dim New_Folder_Path As String = oProjectPath & "DXF Files"
'MessageBox.Show(New_Folder_Path)
My.Computer.FileSystem.CreateDirectory(New_Folder_Path) ']

dim oasmdoc as assemblydocument = thisdoc.document

'ask user for rev level
dim rev_level as string = ""
rev_level = inputbox ("enter rev level","creating dxf files for entire assembly")

dim r_part as string
dim omaterial as string

for each doc as document in oasmdoc.allreferenceddocuments
if doc.subtype = "{9c464203-9bae-11d3-8bad-0060b0ce6bb4}" then
try
r_part = doc.displayname
omaterial = doc.componentdefinition.material.name
othickness = round(doc.componentdefinition.thickness.value/2.54,4)'convert cm to inch
gauge_path = new_folder_path & "\" & othickness & " " & omaterial
'messagebox.show(gauge_path )
try
my.computer.filesystem.createdirectory(gauge_path)
catch
end try
call make_dxf(doc,oasmdoc, rev_level, gauge_path,othickness,omaterial)
catch
end try
end if
next
msgbox("dxf export complete",,"all done")

end sub

sub make_dxf(odoc as document,asmdoc as document, rev_l as string, file_location as string,othickness as double ,omaterial as string)

dim obom as bom = asmdoc.componentdefinition.bom
obom.partsonlyviewenabled = true
dim obomview as bomview = obom.bomviews.item(3)'bom only parts

for each obomrow as bomrow in obomview.bomrows
dim rdoc as document = obomrow.componentdefinitions.item(1).document
if rdoc.displayname = odoc.displayname then

dim oqty as integer = obomrow.totalquantity

thisapplication.documents.open(odoc.fullfilename, true)

dim part_name as string = odoc.displayname

dim rev_adder as string = ""
if rev_l <> "" then rev_adder = " rev " & rev_l

dim a as string = odoc.propertysets.item("design tracking properties").item("stock number").value

dim ofilename as string = file_location & "\" & "mark_" & a & "-" & omaterial & "-thk_" & othickness & "_in-qty_" & oqty & "_" & rev_adder & ".dxf"

'messagebox.show(ofilename)

dim ocompdef as sheetmetalcomponentdefinition = odoc.componentdefinition

if ocompdef.hasflatpattern = false then
ocompdef.unfold
else
ocompdef.flatpattern.edit
end if

dim odataio as dataio = odoc.componentdefinition.dataio
odataio.writedatatofile("flat pattern dxf?acadversion=r12&rebasegeometry=true&simplifyspline=true&interiorprofileslayer=iv_interior_profiles&invisiblelayers=iv_tangent;iv_bend;iv_bend_down;iv_tool_center_down;iv_arc_centers;iv_feature_profiles;iv_feature_profiles_down;iv_unconsumed_sketches;iv_roll_tangent;iv_roll&splinetolerancedouble=0.01", ofilename)

ocompdef.flatpattern.exitedit
odoc.close
exit for
end if
next

end sub
 
Hello, Sergio.

I changed something to your code to fit my needs and work perfectly. Thank you.

I try to ask you something else:

Is there any system to export the file name or part of the name automatically to be able to pull it (grave) then with the laser? It seems to me already an impossible mission to avoid possible holes in the flat pattern but I still try. It seemed impossible to separate the dxfs for thickness but you showed me how.
 

Forum statistics

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

Members online

No members online now.
Back
Top