×
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

BOM

BOM

(OP)
Hello,

I red some arts about BOM, but I can't still figure out, why I do not have mass position in "Define formats".

Best Regards
Santa123

RE: BOM

(OP)
Thanks ferdo

I have Catia R21 and when I right click on the value field of the new property I have options:
- Add Multiple Values
- Add Range
- Edict Comment
- Lock

I do not have formula option, but I can add formula by means of formula button from Knowledge Tool bar.
Is it possible to add parameters to Product Added field by macro?

Respect
Santa123

RE: BOM

(OP)
Hi,

But I ned to add mass and material to 50 existing Parts, so I think the best way to do this is by means of macro.

Respect
Santa123

RE: BOM

I wrote a small code for You:

CODE -->

Language="VBSCRIPT"

Sub CATMain()

Set documents1 = CATIA.Documents


for i=1 to CATIA.Documents.count

Set partDocument1 = documents1.item(i)

if typename(partDocument1)="PartDocument" then

Set product1 = partDocument1.Product

Set parameters1 = product1.UserRefProperties

Set part1 = partDocument1.Part

Set parameters2 = part1.Parameters

Set strParam2 = parameters2.Item("Material")

 Err.Clear
  On Error Resume Next
    Set strParam1=parameters1.Item("Material")
    errNumber = CLng(Err.Number)

if errNumber <> 0 then
Set strParam1 = parameters1.CreateString("Material", strParam2.Value)
else
strParam1.valuatefromstring(strParam2.Value)
end if

Err.Clear
  On Error Resume Next
    Set dimension1 = parameters1.Item("Mass")
    errNumber = CLng(Err.Number)
if errNumber <> 0 then
Set dimension1 = parameters1.CreateDimension("Mass", "MASS", 0.000000)
dimension1.ValuateFromString Cstr(1000000*product1.analyze.mass)&"mg"
else
dimension1.ValuateFromString Cstr(1000000*product1.analyze.mass)&"mg"
end if

end if
next

End Sub 

Let me know if it works

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: BOM

(OP)
Wooooow, This is what I was looking for. Works great, Thanks a lot. This code will save me a lot of time. Tell me one more think, where is a place in the code, where You receive mass.

Respect
Santa123

RE: BOM

CODE -->

product1.analyze.mass 
(as integer)

Anyway, You can use this code to set and update those parameters.

To change parameter name change "Mass" in line above

Mass is calculated automatically for each part in properties->mass depending on volume and density, You need to define material properties (density) to get proper value

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: BOM

Hi,
lukaszsz / fernando

I wonder is there any way to link this mass to the drawing document parameter named "weight" which in-turn will link back to a text in background as an attribute link.
i.e
Mass -----------------------> Weight --------------------------> Text
(Part Parameter) or (Drawing Parameter) (Drawing Text)
(Product Parameter)

establishing an external link while doing the above said parameter mapping will make the job a lot easier.

Also,
How to create external properties using macro and add a relation between them, I mean two different documents.(could u make an example and show for better clarity.)
Automation Documentation doesn't really provide any information on this. Do we have to this external linking manually or what?
could you guys help me on the same.

Regards.
Maddy

RE: BOM

Quote:

I wonder is there any way to link this mass to the drawing document parameter named "weight" which in-turn will link back to a text in background as an attribute link.

It could be very interesting, as I found, there is no possibility to create external parameter through CATIA (as end-user), maybe automation will helps. There is no other option than try do it yourself :)


Quote:

Also,
How to create external properties using macro and add a relation between them, I mean two different documents.(could u make an example and show for better clarity.)

External parameters via VBA:
http://v5vb.wordpress.com/2010/05/11/developing-na...
How to define UserDefinedProperties as relation with existing parameter
http://www.eng-tips.com/viewthread.cfm?qid=341826 (12th reply)

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: BOM

Hi,

Sorry if i'm wrong, this is in regard with automation only.

I want to simulate end user activity in linking parameter of one document with the parameter of other document.
take Mass as said above.
End user activity
1. User will measure the inertia which creates "Mass" in part document.
2. User will create a parameter in drawing called "Weight"
3. User will link this drawing parameter "Weight" with the "Mass" of part parameter through f(x) dialog box.
- Doing so will result in creation of external parameter automatically in drawing along with relation (i.e similar to formula creation).
If user changes the part then mass will get changed.
To get the updated "Mass" value displayed in "Weight"'s property, user needs to sync the external parameter in drawing.

My requirement is to simulate the same through automation.

If not clear will upload a video for reference.

Regards,
Maddy


RE: BOM

oops,sorry forgot to mention

Thanks for time though and will go through v5vb


Regards,
Maddy

RE: BOM

Quote:

3. User will link this drawing parameter "Weight" with the "Mass" of part parameter through f(x) dialog box.

How does formula look like? I'm wondering, because I've never linked external parameters through f(x) without copy-paste special elements.

Of course, If You know how to perform those steps as end-user, it also can be done automatically, through VBA/VBScript.

At this moment the only solution I know is to update Weight parameter through catvba, with no links to referenced CatPart or its parameters, so please, post Yours formula.

Lukasz

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

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