×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

place copy of mass field to file properties

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

Create the Custom Property called MASS, assign it as Text, and use the string "%{MASS}" in the Value box.

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

It won't show it in the Properties dialog. You'll have to use a callout or the like to display it.

What are you trying to do? Why not just call the actual Mass property?

RE: place copy of mass field to file properties

(OP)
I am implementing pdmworks enterprise pdm and i need to map mass field from solidedge to pdmworks.I can only map fields from file properties.If i can have the mass field value in the custom tab, i can transfer it automatically to pdmworks datacard... As you told me in pdmworks in mass field it appears the string "%{MASS}" as it is in file properties - custom - mass but not the value itself..

RE: place copy of mass field to file properties

The easiest thing might be a VB script to extract the Physical Properties and then write it to a Custom Property. Do you have VB.Net or VB6?

RE: place copy of mass field to file properties

(OP)
can you do it in VB.net? i think for us it doesn't matter in what..just to be done..bigsmile

RE: place copy of mass field to file properties

I have VB6, but not the time to do it at the moment. I can give you code to compute and retrieve the mass if you have any programming experience at all. Otherwise I'm off until next Tuesday. Attached is an .exe but it will only do one model at a time. Next week I can maybe make it cycle through all models in a directory.

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

(OP)
I do not have programming experience, i do not know exactly what to do with this code...I will wait till next tuesday and i hope you will have time then to help me with this problem.

RE: place copy of mass field to file properties

Open a part file, run the attached .exe file via

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

(OP)
The attached file is a .bas extension, it must be .exe or .dll in order to run it

RE: place copy of mass field to file properties

(OP)
After i run the macro when i have open a .psm file, on the custom tab it appears a field called MASS of number type but with value 0.Also at inspect- physical properties - mass the value changes to 0.Before i was running this macro i checked this value here and was different from 0.

RE: place copy of mass field to file properties

(OP)
I have tested your macro.I have noticed the following:
- 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

The way Solid Edge works, all measurements are based on a single unit. Then a corresponding value is used to display whatever the user has selected as the display units.

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

(OP)
If i update the mass i need to automatically update his copy in file properties - custom.If it does not automatically and i have to run macro all time manually it is the same as i would copy from physical properties and paste it to file properties - custom...so there is no advantage, it's the same...
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

You could have a 'close file' macro that updated the mass and the custom property before closing the file.
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

(OP)
I probably could use a macro, that is  not a big problem, the main problem is that i need to place automatically a copy of the mass value to file properties - custom.Yes i could use pdf files of drawings and store tham into some document management program, but that is a nother separate program and i need to have all informations regarding to items in one place - pdm.

RE: place copy of mass field to file properties

I think one of the problems could be in using pdmworks.
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

(OP)
I need the mass becouse i need to transfer it automatically to the erp system.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources