API and Coordinate Systems

Discussion in 'SolidWorks' started by tszeis, Oct 17, 2006.

  1. tszeis

    tszeis Guest

    I'd like to use custom created Coordinate Systems as a means to
    position things in a Solidworks assembly using API.

    Does anyone have experience doing this type of thing?
     
    tszeis, Oct 17, 2006
    #1
  2. tszeis

    Frank Möbus Guest

    I'd like to use custom created Coordinate Systems as a means to
    What do you want to position in your assembly? Parts or something else.
    I have only little experience with position parts in assemblies, using
    their Component2 Objects, which represent the parts within assembly
    documents. These Component2 Objects hold the geometrical transformation
    information and provide methods to manipulate it.
    If this meets your needs I can describe it a little more in detail.
    If not, please describe your problem in detail.

    greetz
     
    Frank Möbus, Oct 18, 2006
    #2
  3. tszeis

    tszeis Guest

    I'm not sure if the Component2 matches my needs or not. It sounds
    like it might. What I want to do is position parts in an assembly bases
    on positional references. I thought about using named faces and
    automating but it seems too complex and its overkill, since the parts
    I'm assembling could be set in a fixed location and still serve the
    purpose.
     
    tszeis, Oct 18, 2006
    #3
  4. tszeis

    Frank Möbus Guest

    I'm not sure if the Component2 matches my needs or not. It sounds
    Let's start with the basics. How to put parts in assemblies. Therefore
    you've got your AssemblyDoc object which represents your assembly document.
    First you have to add a part using AssemblyDoc::AddComponent4. This
    method(function) needs the partfilename and the position (x,y,z coords)
    where you want to put this part in the assembly. This method returns a
    Component2 object which represents this part. Now you can put a further
    part to the assembly document by using the same function. You will get
    another Component2 object for this part.

    If you want to reposition the parts in the assembly you can obtain an
    transformation object from the Component2 objects using
    Component2::Transform2. This function returns a MathTransform object
    which handles the geometrical transformation of the Component2 (part in
    the assembly). Now you can repostion you part in terms of 4x4
    transformation matrix (you should be familiar with this)



    Now I will guess a little, what you meant with:
    You want to align 2 parts (part1 and part2) e.g. so that a face of part1
    is next to an face of part2 (e.g. distance zero and parallel) by using
    named faces. Therefore you will need to deal with AssemblyMates. Named
    faces are a good idea, due to selecting these faces. This you will need
    to mate them in the assembly.

    any questions? just ask :eek:)
     
    Frank Möbus, Oct 18, 2006
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.