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

cancellation

  • Thread starter Thread starter Ch.giacomo
  • Start date Start date

Ch.giacomo

Guest
hello to all, I have a bit annoying problem, deleting aspects in .ipt files.

I start from the step sent by the customer, once imported I see the colors set by the customer and when I go to set the material the components do not change color, so I have to open every single .ipt and click on delete appearance confirm save and close, for every single piece.

Has anyone had the same problem? How did you solve this? Maybe there is a macro that by selecting ipt files also manually in a set opens deletes the look saves and closes?

Thank you very much in advance
 
Sorry to ask my question again, but I need help.

I'll explain. I have a set of ipts that have appearance replacement and should remove appearance from every single file.

for now I do it for every single file "open - delete appearance - save - close"

my question is you could do an automation of this process?

Thank you so much!!
 
but the aspect replacement function can be on the single ipt and can be in the axieme.
in my case is on every single ipt.
if you could manage in iproperties would be easier.. Obviously it is a graphical parameter managed differently.

what I do not explain is that if a designer plays with the colors of the faces on hundreds of ipts you can not remove this “parameter” more easily. .
Thank you.
 
dopo mesi di ricerche... ho trovato questa regola, è un pò di tempo che la uso e non mi ricordo la fonte.. ma la ringrazio molto.

rimuove tutti gli aspetti dall'assieme:


syntaxeditor code snippet dim title as string = "excitech ilogic"

' attempt to get the active assembly document
dim odoc as assemblydocument = nothing
try
odoc = thisapplication.activeeditdocument
catch
messagebox.show("this rule must be run from an assembly", title)
exit sub
end try

dim oadoc as assemblydocument = nothing
dim opdoc as partdocument = nothing
dim totcount as integer = odoc.allreferenceddocuments.count

dim odef as assemblycomponentdefinition = odoc.componentdefinition
dim orefdoc as document = nothing
dim opartdef as partcomponentdefinition = nothing
dim oasmdef as assemblycomponentdefinition = nothing
dim failcount as integer = 0

dim count as integer = 1

' top level clear override command
odef.clearappearanceoverrides()

' loop through all the documents referenced by this assembly document...
for each orefdoc in odoc.allreferenceddocuments
try
thisapplication.statusbartext = count & " of " & totcount & " components processed."

' is it a part document?
if orefdoc.documenttype = documenttypeenum.kpartdocumentobject then
' get the component definition.
opartdef = orefdoc.componentdefinition

' first set the top level part appearance to be the same as the material
orefdoc.appearancesourcetype = appearancesourcetypeenum.kmaterialappearance

' try a top level 'clear appearance overrides' command first
opartdef.clearappearanceoverrides()

' clear the override on all the override objects found....
opartdef.clearappearanceoverrides(objcoll)

thisapplication.activeview.update()

' is it an assembly document?
elseif orefdoc.documenttype = documenttypeenum.kassemblydocumentobject then
' get the assembly definition
oasmdef = orefdoc.componentdefinition
' run top level 'clear appearances' command on this assembly
thisapplication.statusbartext = count & " of " & totcount & " components processed. clearing assembly overrides..."
oasmdef.clearappearanceoverrides()
end if
count += 1
catch
failcount += 1
end try
next

thisapplication.activeview.update()

if failcount > 0 then
msgbox("all appearance overrides removed." & vblf & vblf & _
"operation failed on " & failcount & " component(s) - these may be read-only.", , title)
else
msgbox("all appearance overrides removed.", , title)
end if
 
dopo mesi di ricerche... ho trovato questa regola, è un pò di tempo che la uso e non mi ricordo la fonte.. ma la ringrazio molto.

rimuove tutti gli aspetti dall'assieme:


syntaxeditor code snippet dim title as string = "excitech ilogic"

' attempt to get the active assembly document
dim odoc as assemblydocument = nothing
try
odoc = thisapplication.activeeditdocument
catch
messagebox.show("this rule must be run from an assembly", title)
exit sub
end try

dim oadoc as assemblydocument = nothing
dim opdoc as partdocument = nothing
dim totcount as integer = odoc.allreferenceddocuments.count

dim odef as assemblycomponentdefinition = odoc.componentdefinition
dim orefdoc as document = nothing
dim opartdef as partcomponentdefinition = nothing
dim oasmdef as assemblycomponentdefinition = nothing
dim failcount as integer = 0

dim count as integer = 1

' top level clear override command
odef.clearappearanceoverrides()

' loop through all the documents referenced by this assembly document...
for each orefdoc in odoc.allreferenceddocuments
try
thisapplication.statusbartext = count & " of " & totcount & " components processed."

' is it a part document?
if orefdoc.documenttype = documenttypeenum.kpartdocumentobject then
' get the component definition.
opartdef = orefdoc.componentdefinition

' first set the top level part appearance to be the same as the material
orefdoc.appearancesourcetype = appearancesourcetypeenum.kmaterialappearance

' try a top level 'clear appearance overrides' command first
opartdef.clearappearanceoverrides()

' clear the override on all the override objects found....
opartdef.clearappearanceoverrides(objcoll)

thisapplication.activeview.update()

' is it an assembly document?
elseif orefdoc.documenttype = documenttypeenum.kassemblydocumentobject then
' get the assembly definition
oasmdef = orefdoc.componentdefinition
' run top level 'clear appearances' command on this assembly
thisapplication.statusbartext = count & " of " & totcount & " components processed. clearing assembly overrides..."
oasmdef.clearappearanceoverrides()
end if
count += 1
catch
failcount += 1
end try
next

thisapplication.activeview.update()

if failcount > 0 then
msgbox("all appearance overrides removed." & vblf & vblf & _
"operation failed on " & failcount & " component(s) - these may be read-only.", , title)
else
msgbox("all appearance overrides removed.", , title)
end if
Hi.
But does it work to you? to me from mistakes
 

Forum statistics

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

Members online

No members online now.
ciao
Back
Top