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

macro quotas

  • Thread starter Thread starter simoness
  • Start date Start date
Good morning,
I noticed a problem.
I can suspend a "feature" object with a
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentsuppressed)

but at its reactivation,
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentfullyresolved)

Nothing happens.

It turns out, but it doesn't turn on again.

where is the error?
 
Good morning,
I noticed a problem.
I can suspend a "feature" object with a
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentsuppressed)

but at its reactivation,
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentfullyresolved)Nothing happens.

It turns out, but it doesn't turn on again.

where is the error?
Isn't that unsuppressed? I press that I have not understood the macro, I am not pro like you...ahaha
 
Good morning,
I noticed a problem.
I can suspend a "feature" object with a
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentsuppressed)

but at its reactivation,
swfeat.setsuppression (swcomponentsuppressionstate_e.swcomponentfullyresolved)

Nothing happens.

It turns out, but it doesn't turn on again.

where is the error?
I think you have to reactivate a feature while you're reactivating a component
( swcomponent(ii)
use method
setsuppression2 method (ifeature) because the other is obsolete since 2004

writing should be this:swfeat.setsuppression2(swfeaturesuppressionaction_e.swunsuppressfeature,swinconfigurationopts_e enumeration.swallconfiguration)

then decide in the second parameter on which configurations or all
 
I think you have to reactivate a feature while you're reactivating a component
( swcomponent(ii)
use method
setsuppression2 method (ifeature) because the other is obsolete since 2004

writing should be this:swfeat.setsuppression2(swfeaturesuppressionaction_e.swunsuppressfeature,swinconfigurationopts_e enumeration.swallconfiguration)

then decide in the second parameter on which configurations or all
This is true, but strangely to suspend it, does it also take swcomponent?
 
from that this is easy, volume and other properties of the part come out from the method
volume property (massproperty2)
 
from that this is easy, volume and other properties of the part come out from the method
volume property (massproperty2)
instead it is more difficult than expected.
I don't know why, but it gives me the volume of all parts to the same configuration.
reiterating for the mass, always turns in the first configuration
 
posto per esempio, la parte del codice

dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
dim swassy as sldworks.assemblydoc
dim vmass as variant
dim volume as double
dim swcompbody as sldworks.body2
dim swcompmodel as sldworks.modeldoc2



set swapp = application.sldworks
set swmodel = swapp.activedoc
set swassy = swmodel

dim vcomp as variant
vcomp = swassy.getcomponents(false)

if not isempty(vcomp) then
dim i as integer
for i = 0 to ubound(vcomp)
set swcomp = vcomp(i)
dim modelc as assemblydoc
set modelc = swcomp.getmodeldoc2
dim vmodelc as variant
vmodelc = modelc.getcomponents(false)
dim modelcc as component2
dim h as integer
for h = 0 to ubound(vmodelc)
set modelcc = vmodelc(h)
set swcompbody = modelcc.getbody
set swcompmodel = modelcc.getmodeldoc
volume = swcompmodel.getuserpreferencedoublevalue(swmaterialpropertydensity)
vmass = swcompbody.getmassproperties(volume)
if modelcc.name2 = "nome" & userform1.combobox then
userform2.controls("valore1" & userform1.combobox).value = round(vmass(3), 2)
end if
if modelcc.name2 = "nome2" & userform1.combobox then
userform2.controls("valore2" & userform1.combobox).value = round(vmass(3), 2)
end if
next h
next i
end if
 
in fact if I make a debug.print modelcc.referencedconfiguration, known that it always turns on the same configuration.
but it is usually the same engine I used to change the odds, turn off/light components and features.
I can't understand where I'm wrong.
 
in fact if I make a debug.print modelcc.referencedconfiguration, known that it always turns on the same configuration.
but it is usually the same engine I used to change the odds, turn off/light components and features.
I can't understand where I'm wrong.
in fact there is no possibility of obtaining mass properties for each configuration, this because the configuration is loaded and updated once you activate it.
I think you have to cycle all configurations by activating them one at a time and obtaining mass properties. at the end let the configuration you started before the cycle.
 
in fact there is no possibility of obtaining mass properties for each configuration, this because the configuration is loaded and updated once you activate it.
I think you have to cycle all configurations by activating them one at a time and obtaining mass properties. at the end let the configuration you started before the cycle.
If it were to serve, I followed this example, properly modified then, to solve the problem. it is not necessary to cycle all configurations and at the end to activate the initial one.
the example then shows which enum I have to do to get the volume.

I got the volume, for every component I was going to cycle, considering that this last one, is already in the configuration I need.
 

Forum statistics

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

Members online

No members online now.
Back
Top