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

esporta faccia con nome - census apri

  • Thread starter Thread starter Tarkus
  • Start date Start date

Tarkus

Guest
I do not know whether to reconnect to similar discussions or start from scratch:
if I want to get a dxf file to be laser cut or similar I have to do these
-export face by name,
-click on the face,
- Give me the name,
-Save.
-open the file with autocad.
Could these operations be grouped with a rule logic or vba in this sense? :
-export face by name,
-click on the face,
-with sending= dxf or dwg file of autocad opened automatically?
save by name after opening.
I wonder too much?
above all I would like to take off the bega to open autocad and go to search again the folder where I saved the file....
 
if it is sheet metal developments, direct the flat model with the right options of the case
 
Yes, I know, I just want to have automatism to have automatic opening in dxf or dwg, then decide whether to save or simply make a paste copy of the template to paste it into another file. . .
 
to the nose first carry/salve in dxf and then open automatically acad, to the elimination limit (automatic? on request) after...
 
ciao
farei cosi...
'******************************************************************************************
'www.mc-cad.it
'info@mc-cad.it
'******************************************************************************************
revisione = iproperties.value("project", "revision number")

'se compilo nelle iproperties il campo revisione
'esempio _rev1
'allora cerca ed apre il file nome_rev1.dxf dove nome è ugulale al nome 3d.ipt

dxf=thisdoc.pathandfilename(false) & revisione & ".dxf"'without extension

if(system.io.file.exists(dxf)) then
thisdoc.launch( dxf)
else
messagebox.show("manca il dxf", "mc-cad")
end if
 
ciao
farei cosi...
'******************************************************************************************
'www.mc-cad.it
'info@mc-cad.it
'******************************************************************************************
revisione = iproperties.value("project", "revision number")

'se compilo nelle iproperties il campo revisione
'esempio _rev1
'allora cerca ed apre il file nome_rev1.dxf dove nome è ugulale al nome 3d.ipt

dxf=thisdoc.pathandfilename(false) & revisione & ".dxf"'without extension

if(system.io.file.exists(dxf)) then
thisdoc.launch( dxf)
else
messagebox.show("manca il dxf", "mc-cad")
end if
Okay, it could be a road, but I'd like you to start the whole thing with the command "get out face by name"
 
raw and to be fixed, connect the macro to a key
if there is no flat pattern and no selected face does nothing
if there is no flat pattern and a selected face makes the explanation with the face as a base

if there is flat model (or has just created it) export to dxf and opens the design with acad. the design exports it anyway, at the limit then you can delete

I don't have time to do anything else, see if it's a decent start. Test it a bit before you entrust us with the work of a life: but should not do too much damage: alcohol:
Bye!
Code:
sub testopendxf()
    ' get the active document.  this assumes it is a part document.
    dim odoc as partdocument
    set odoc = thisapplication.activedocument

    dim odoccompdef as sheetmetalcomponentdefinition
    set odoccompdef = odoc.componentdefinition
    
    dim osset as selectset
    set osset = odoc.selectset
    debug.print osset.count
    
    if odoccompdef.hasflatpattern = false then
        if osset.count = 1 then
            odoccompdef.asidedefinitions.add (osset.item(1))
            odoccompdef.unfold
            
                ' get the dataio object.
                dim odataio as dataio
                set odataio = odoc.componentdefinition.dataio
            
                ' build the string that defines the format of the dxf file.
                dim sout as string
                sout = "flat pattern dxf?acadversion=r12&outerprofilelayer=outer"
                
                dim myfilename as string
                myfilename = strings.replace(odoc.fullfilename, ".ipt", ".dxf")
                debug.print myfilename
                ' create the dxf file.
                odataio.writedatatofile sout, myfilename
                
                dim oacad as object
            
                on error resume next
                
                set oacad = getobject(, "autocad.application")
                debug.print "get acad"
                if err <> 0 then
                debug.print "open acad"
                set oacad = createobject("autocad.application")
                err.clear
                on error goto 0
                end if
                
                
                call oacad.documents.open(myfilename, true)
                oacad.visible = true
                set oacad = nothing
                set odoc = nothing
                set odoccompdef = nothing
        end if
    end if
end sub
 
thanks catafract,
I'm taken from pre-low deliveries, I think I can test it on the return.
Then I'll let you know
 

Forum statistics

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

Members online

No members online now.
Back
Top