place copy of mass field to file properties
place copy of mass field to file properties
(OP)
For solidedge v.20 (for st3 is the same) how can you make a customization so that a copy of the mass field in a solidedge part file (.psm, .prt) found at inspect- physical properties – mass to be available automatically updated in file- file properties – custom in a custom field called mass?





RE: place copy of mass field to file properties
However, I am unsure of how to update it automatically, without having to update the physical properties. Also, if you use the custom property as a callout or in a title block, you will have to Update Property Text as well.
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
What are you trying to do? Why not just call the actual Mass property?
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
I do not know blockname for mass now, but if i can put to custom then the blockname will be custom.
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
Here's the code:
Public objModel As SolidEdgePart.Model
Public seApp
Dim objVariables As SolidEdgeFramework.Variables
Dim objVariable As SolidEdgeFramework.variable
Dim objVar1 As SolidEdgeFramework.variable
Public dbldensity As Double
Public dblAccuracyIn As Double
Public dblAccuracyOut As Double
Public dblVolume As Double
Public dblArea As Double
Public dblMass As Double
Public dblCofGravity() As Double
Public dblCofVolume(1 To 3) As Double
Public dblGlobalMoments(1 To 6) As Double
Public dblPrincipalMoments(1 To 3) As Double
Public dblPrincipalAxes(1 To 9) As Double
Public dblRadiiOfGyration(1 To 3) As Double
Public lngStatus As Long
Public dblStartRadiusArray() As Double
Public dblEndRadiusArray() As Double
Sub Main()
Set seApp = GetObject(, "SolidEdge.Application")
Set objModel = seApp.activedocument.Models(1)
'Get Variables Collection
Set objVariables = seApp.activedocument.Variables
'Create a variable with Add method
'Get a reference to Variable1 using Item method
Set objVar1 = objVariables.Item(1)
100
'MsgBox objVariables.Item(3).Name
dbldensity = objVariables.Item(1).Value
dblAccuracyIn = objVariables.Item(3).Value
Call GET_MASS(dbldensity)
MASS = dblMass
End Sub
Function GET_MASS(dbldensity)
' Recompute to ensure correct model info
Call objModel.ComputePhysicalProperties( _
Density:=dbldensity, Accuracy:=dblAccuracyIn, Volume:=dblVolume, _
Area:=dblArea, MASS:=dblMass, CenterOfGravity:=dblCofGravity, _
CenterOfVolume:=dblCofVolume, _
GlobalMomentsOfInteria:=dblGlobalMoments, _
PrincipalMomentsOfInteria:=dblPrincipalMoments, _
PrincipalAxes:=dblPrincipalAxes, _
RadiiOfGyration:=dblRadiiOfGyration, _
RelativeAccuracyAchieved:=dblAccuracyOut, Status:=lngStatus)
' Retrieve properties
Call objModel.GetPhysicalProperties(lngStatus, dbldensity, dblAccuracyIn, dblVolume, dblArea, dblMass, dblCofGravity, dblCofVolume, dblGlobalMoments, dblPrincipalMoments, dblPrincipalAxes, dblRadiiOfGyration, dblAccuracyOut)
Set X = seApp.activedocument.Properties.Item("Custom").Add("MASS", Round(dblMass, 3) * 2.20462262)
End Function
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
Application --> Macros --> Run Macro
And let me know if it does what you want.
Also, do you need this for Assemblies also?
what is your directory structure? Do you use Insight?
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
- in one ocasion gave error see attachment
- in the other occasions it always shows much higher value then real for example if in physical properties i have 50.245 kg in file properties will show around 105 kg almoust double..
- whenewer i make a action to change weight (example a big hole) the value in physical properties updates when i click update or save the file, but in file properties it does not change the value until i run again the macro.If i run the weight changes but it is still around double of the normal weight.
RE: place copy of mass field to file properties
Thus, I programmed in to the macro a value of KG vs. LBS, which explains why you are seeing the double-ish values.
Also, as I mentioned in the beginning, there is no method I know of that will update the custom property automatically if the values of the physical properties change. I might be able to do it based on a formula using the variables table.
I'm at home and do not have access to any software so I'll look at it next week.
Are you switching to SolidWorks or just their PDM?
RE: place copy of mass field to file properties
Even if pdmworks says his pdm is integrated to solidedge, there are several things that do not work as it should be, one example would be this thing with mass mapping.I would seriously consider changeing to solidworks the problem is migration from one to the another becouse we lose data and needs to be manually corrected..much wasted time.Eversince Siemens bought UGS, they changed licenseing methodology for pdm Teamcenter, there is no nore concurrent license now just nominal.That means that for example if you have 1 computer in factory and 100 factory workers to see with different rights different drawings (depending on their job, roles) you need to buy 100 viewer licenses of Teamcenter value more then 10000 euro.Instead in pdmworks you can buy just one concurrent license >500 euro for the same effect.
RE: place copy of mass field to file properties
Why not use pdf's of drawings, as many companies do now - the viewer is free.
bc.
2.4GHz Core2 Quad, 4GB RAM,
Quadro FX4600.
Where would we be without sat-nav?
RE: place copy of mass field to file properties
RE: place copy of mass field to file properties
Surely that's intended for SolidWorks not Solid Edge, and if it doesn't do what you want it to you should contact the people who sold it to you.
Can't you use the free SolidEdge viewer?
Can't pdmworks handle pdf files?
bc.
2.4GHz Core2 Quad, 4GB RAM,
Quadro FX4600.
Where would we be without sat-nav?
RE: place copy of mass field to file properties