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

problema con macro

  • Thread starter Thread starter teseo
  • Start date Start date

teseo

Guest
hello to everyone I was working on a macro that is present on this forum but that I slightly modified. ..now manages assemblies and parts(first only parts). allego
the macro writes of the properties previously inserted in a part or in a set.

but now I have the need to write to the macro the properties previously inserted also in the configurations and not only in the standard of the part or together.

I think the line to change is this

retval = swmodel.addcustominfo3("", "material", swcustominfotext, """ & "sw-material@" & swmodel.gettitle & ".sldprt" & """)

How? ? ?

Thank you.View attachment Edit Custom Properties.rar
 
hello to everyone I was working on a macro that is present on this forum but that I slightly modified. ..now manages assemblies and parts(first only parts). allego
the macro writes of the properties previously inserted in a part or in a set.

but now I have the need to write to the macro the properties previously inserted also in the configurations and not only in the standard of the part or together.

I think the line to change is this

retval = swmodel.addcustominfo3("", "material", swcustominfotext, """ & "sw-material@" & swmodel.gettitle & ".sldprt" & """)

How? ? ?

Thank you.View attachment 46541
Hi, Teseo.
I've updated the macro that you find attached.

I wondered why in the macro you put the inputbox message 1 or 2.
if you do so to tell him if he has to enter properties depending on whether it is a part or a set, you can get up the type of document you have active and consequently manage it:

select houses swmodel.gettype
houses swdocpart
'here you write the part of code that you pass with the current 1
houses swdocassembly
'Here you write the part of code that passes it with the current 2
houses swdocdrawing
exit sub
homes else
exit sub
end select


Hi.
 

Attachments

Hi, Teseo.
I've updated the macro that you find attached.

I wondered why in the macro you put the inputbox message 1 or 2.
if you do so to tell him if he has to enter properties depending on whether it is a part or a set, you can get up the type of document you have active and consequently manage it:

select houses swmodel.gettype
houses swdocpart
'here you write the part of code that you pass with the current 1
houses swdocassembly
'Here you write the part of code that passes it with the current 2
houses swdocdrawing
exit sub
homes else
exit sub
end select


Hi.
and already you are a handle I a sink now work thanks jenuary if a big.... .
 
It's not that I want to get it, but I want to get it.

for i = 0 to ubound(vconfname)
'
set swconfig = swmodel.getconfigurationbyname(vconfname(s))

set swcustpropmgr = swmodel.extension.custompropertymanager(swconfig.name)

Let's see if I understand:
cycle all configurations
a swconfig gives the value of the configuration name
and then the swcustpropmgr check and then make replacement. . .

swcustpropmgr is an unknown thing where I can find a help......

Hi.
 
It's not that I want to get it, but I want to get it.

for i = 0 to ubound(vconfname)
'
set swconfig = swmodel.getconfigurationbyname(vconfname(s))

set swcustpropmgr = swmodel.extension.custompropertymanager(swconfig.name)

Let's see if I understand:
cycle all configurations
a swconfig gives the value of the configuration name
and then the swcustpropmgr check and then make replacement. . .

swcustpropmgr is an unknown thing where I can find a help......

Hi.
swcustpropmgr is the object (but you can call it by the name you want) that gives access to the properties, in this case of the cycle configuration, if the steps "" takes the custom-made general properties.
in the manual bees you have to watch custompropertymanager which is the call for your variable.
http://help.solidworks.com/2016/eng...rks.iconfiguration~custompropertymanager.htmlThese opportunists...:cool:

... you did well to ask, go quietly.

Hi.
 

Forum statistics

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

Members online

No members online now.
Back
Top