Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change parameter value at assembly doc in API

Status
Not open for further replies.

ZsZs

Computer
May 8, 2007
30
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.
 
Replies continue below

Recommended for you

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.
 
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.

[bat]Honesty may be the best policy, but insanity is a better defense.[bat]
-SolidWorks API VB programming help
 
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.
 
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.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor