|
where is resetuntitledcount api ?
who can tell me where is resetuntitledcount api ,and how to use it?
what are you trying to achieve here? that function/property does not exist where did you get the name from?
i sent e-mail to ask apisupport@solidworks.com problem is "after start solidworks ,the solidworks system automatically generates names of the part1, part2 ... , assembly1, assembly2 ... ,after generated parts1 or assembly1,shut parts1 or assembly1, without restart solidworks circumstances but allow solidworks still generates parts1 or assembly1 rather than parts2 or assembly2."
my god! who can solve my problem?
what you are trying to say is when you create a new part or assembly it gives in a default name of part1, assembly1, then the next ones are part2, assembly2. if you close down part1 and create a new part, its new name is part2.
this is normal behaviour in most programs. as for resetting that default name number count, there is no api for it but if you request it they may add it, or they may have a way around some other way.
why do you need this number to reset to 1 anyway?
my program needs this function,or i must restart solidworks system,it's so slow,after restart solidworks system,the solidworks system automatically generates names of the part1, part2 ... , assembly1, assembly2 ... ,i need it.
yes but for what purpose? the name is purely temporary and of no use. if you want to save the part as part1, just use modeldoc2::extension::saveas, and pass in the filename you wish to use
after it generates part1 or assembly1,i want to generate other part1 or assembly1,if you use "modeldoc2::extension::saveas",i know what you said,you must restart solidworks system to generate other part1 or assembly1.
like i said the name it gives each new part is purely temporary there is no need to use it or restart solidworks. if you are really bothered about it visually showing the title "part2" in the window then just do the following to overwrite it:
option explicit
dim swapp as sldworks.sldworks
dim part as modeldoc2
sub main()
set swapp = application.sldworks
set part = swapp.newdocument("t:\part.prtdot", 0, 0#, 0#)
part.settitle2 "part1"
end sub
and just replace "t:\part.prtdot" with the location of your template
my god,you solve my problem! thank you!!
quick |
|