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

aiuto macro

  • Thread starter Thread starter geppetto
  • Start date Start date

geppetto

Guest
looking through the various discussions I found nothing to do with my case and stealing an existing string I created the pippo property with pluto value:

sub main()

set swapp = _
application.sldworks

set part = swapp.activedoc
part.filesummaryinfo
retval = part.addcustominfo3(configname, "pippo", swcustominfotext, _
" pluto ") 'ad latest values
end

Since in vb are a goat, how do I write this property in the specific configuration tab instead of customized?
Thank you.
 
looking through the various discussions I found nothing to do with my case and stealing an existing string I created the pippo property with pluto value:

sub main()

set swapp = _
application.sldworks

set part = swapp.activedoc
part.filesummaryinfo
retval = part.addcustominfo3(configname, "pippo", swcustominfotext, _
" pluto ") 'ad latest values
end

Since in vb are a goat, how do I write this property in the specific configuration tab instead of customized?
Thank you.
I'm a goat, too, but wouldn't you first record this macro from the graphics area?
or use skeduler task or tab builder?
 
Maybe you could. as well you will know (unless it is just a magheggio to me) sw does not record all macros. access to property is one of the cases where you cannot. tab builder and tasc scheduler would result in little practical in my case. also because the goat, it would also want to introduce "if, else, ekse if". I think I know how to do it.
 
ecco la macro modificata per scrivere nella configurazione attiva

-----------------------
option explicit


public enum swcustominfotype_e

swcustominfotext = 30

end enum



dim swapp as sldworks.sldworks

dim swmodel as sldworks.modeldoc2

dim swconfigmgr as sldworks.configurationmanager

dim swconfig as sldworks.configuration

dim swcustpropmgr as sldworks.custompropertymanager

dim retval as long




sub main()

set swapp = application.sldworks

set swmodel = swapp.activedoc

set swconfigmgr = swmodel.configurationmanager

set swconfig = swconfigmgr.activeconfiguration

set swcustpropmgr = swconfig.custompropertymanager

swmodel.filesummaryinfo

' add custom property date to this configuration

retval = swcustpropmgr.add2("pippo ", swcustominfotext, "pluto")


end sub
------------------------

saluti

flfn
 
Thank you, I never hoped...:biggrin:
the goat wouldn't want to take advantage of your generosity, but how do I overcome the misleading property?
I try to explain, your solution is perfect but if instead of pluto I want a property related to the model (e.g.: "sw-surfacearea@default@part2.sldprt"), the double of quotes in vb mislead me.
even if you could not answer this, thank you infinitely for what you have already done.:finger:
geppetto
 
Hello, geppetto
in relation to your second question, you have to change the macro so that you take the name of the file and the active configuration, and fulfill its definition. if you have more configuration you can make sure that you complete them all automatically, on the bee tutorial there are examples.

I don't know when I can spend time doing this...

greetings
 
Meanwhile, thank you again for what you did.
I should personally change only the active configuration and I in that blessed bee guide (all in English) was unable to find anything about it. I also asked for sw assistance if a guide was available in Italian but it seems that you first learn English. However I will still try to see if I can with some search words to find the solution.
thanks again:finger:
 
ecco la macro modificata per scrivere nella configurazione attiva

-----------------------
option explicit


public enum swcustominfotype_e

swcustominfotext = 30

end enum



dim swapp as sldworks.sldworks

dim swmodel as sldworks.modeldoc2

dim swconfigmgr as sldworks.configurationmanager

dim swconfig as sldworks.configuration

dim swcustpropmgr as sldworks.custompropertymanager

dim retval as long




sub main()

set swapp = application.sldworks

set swmodel = swapp.activedoc

set swconfigmgr = swmodel.configurationmanager

set swconfig = swconfigmgr.activeconfiguration

set swcustpropmgr = swconfig.custompropertymanager

swmodel.filesummaryinfo

' add custom property date to this configuration

retval = swcustpropmgr.add2("pippo ", swcustominfotext, "pluto")


end sub
------------------------

saluti

flfn
Hey, who's new? How's it going, all right?
 
Hi embellishment, let's go pretty well.

as you see when I can, I make my little training contribution. . .
Hi.
 

Forum statistics

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

Members online

No members online now.
Back
Top