×
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

Change parameter value at assembly doc in API

Change parameter value at assembly doc in API

Change parameter value at assembly doc in API

(OP)
Hi!
I'm programmer, and not CAD designer.
I have a big problem:
The parameter handling by the part document was success and it working...
But now, if I have (only) a parameter name (for example: S@Vázlat1) and I known the assembly document name (for example: LABE00.SLDASM), and I dont known the part document name and location.
How that to catch and modify the parameter value?
I working Visual C++ 6.0 .
Thanks!
ZsZs.

RE: Change parameter value at assembly doc in API

How have you found the parameter name?  Can you post some code?  I haven't worked in C since college (mostly VBA for me) but I may be able to help some.

RE: Change parameter value at assembly doc in API

If a parameter belongs to a part, you need to access it through that part.  This means that if you midify the parameter at the assembly level you need to find the part.  I can not think of an exception.

This could mean traversing the entire assembly until you find a part with a matching parameter.  If your parameter has a common name (like "D1@Extrude1"), there is a good chance your program will find the wrong part.

batHonesty may be the best policy, but insanity is a better defense.bat
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Change parameter value at assembly doc in API

(OP)
I developing a furniture-design software.
In the  Solidworks my college design a CAD 2D/3D draw.
And I write a interface, that cache (connect with COM) the Solidworks program, and it my Visual C++ programs modify the CAD plan parameter variables, that it reflect the actual size.

We problem, that have many part in by the furniture structure dependent directury structure (not fix). And we have only 2-4 parameter, taht must be to change.

I program don't know from CAD-plan (draw) sturucture. I don't know the directory wherein  the part document.
I know only the parameters name that must be modified, and the assembly file name.

I remember have the general method to acessing the parameters by name (similar IModelDoc2->SelectByID() method).

Have a chance to find a part doc name (and location) from the parameters name?
I have parameter S@Vázlat1 in the Solidworks. From this parameter name may be to know (or find) the associate part document location?
If it true then I able to open and modify the parameters in the part document.

Thanks!
ZsZs.

RE: Change parameter value at assembly doc in API

How do you find out this parameter name?  You cannot find the name of the part file with only the name of the parameter.  As TheTick said, there can be many parts with a parameter named "S@Vázlat1".  If you know for certain that only one part in the assembly has a parameter with that name, you can examine every parameter of every part of the assembly to see if it has that name.  Otherwise, there is no way.

RE: Change parameter value at assembly doc in API

(OP)
By a convention the parameters derived from the furniture user selected size (x,y,z coordinate). By this is current value I musbe write to Solidworks part document.

The parameter name derived form we convention, X@ = width, Y@ = heigh, Z@ = depth, if it understand.
The @Vázlat is contant all parameters.
The parameters 'X@Vázlat', 'Y@Vázlat', and 'Z@Vázlat'.
But the part document location unknown. It may be "anywhere".

The parameter name is unique. We attend for it.

Whereby examine the parameters in list?
This list connect the assembly file?
Or Open the all part document in full directory dept (origin from sldasm file location - it may be correct chance...) and search the parameters for all?
Can you thell me the method (function) name? (or any example code - any language...)

Thank!
ZsZs.

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