Edit component in assembly?

Edit component in assembly?

Anonymous
Not applicable
394 Views
3 Replies
Message 1 of 4

Edit component in assembly?

Anonymous
Not applicable
If I have a IAM open and activate a component, how do I get access to that
component with the API?

In other words, I want to activate a part in a assembly, and then modify
that part with a program.

It seems like it should be something like
ThisApplication.ActiveDocument.ActiveComponent

Is it possible?

--
Kent Keller
Member of the Autodesk Discussion Forum Moderator Program
0 Likes
395 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
What do you need to do to the activated component? It is not required that
you activate an referenced file (part or sub) in order to get at the
component defintion and document objects of the referenced file.

You can loop through the referenced files in an assembly, pick out the one
required (by filename or ...), and obtain the component definition of the
part or sub. From there you can modify as required.

It would look somewhat like the following:

AssemblyDocument.ComponentDefinition.ImmediateReferencedDefinitions.Item(x).
ReferencedDefinition

That will get you to the component definition of the assembly component. Use
the Document property of the above to get a reference to the document.

Neil


"Kent Keller" wrote in message
news:98E1C23839A4BFE5018D0250A07EB210@in.WebX.maYIadrTaRb...
> If I have a IAM open and activate a component, how do I get access to that
> component with the API?
>
> In other words, I want to activate a part in a assembly, and then modify
> that part with a program.
>
> It seems like it should be something like
> ThisApplication.ActiveDocument.ActiveComponent
>
> Is it possible?
>
> --
> Kent Keller
> Member of the Autodesk Discussion Forum Moderator Program
>
>
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi Neil

Thanks...That gets me to the next step.... we will see how far I get from
there 8^))

Probably the biggest problem is I don't have a real clear picture of what I
am trying to accomplish. One of those deals where the goal was never
thought out completely in the beginning, and now it just keeps moving on me.


--
Kent Keller
Member of the Autodesk Discussion Forum Moderator Program


"Neil Munro" wrote in message
news:0FA255B56A4828AF22E545316A7CEA07@in.WebX.maYIadrTaRb...
>
> It would look somewhat like the following:
>
>
AssemblyDocument.ComponentDefinition.ImmediateReferencedDefinitions.Item(x).
> ReferencedDefinition
0 Likes
Message 4 of 4

Anonymous
Not applicable
The Application.ActiveEditObject will return the object that is currently
open for edit in the user interface. In your example, this will return the
part. If you were editing a sketch in that part, it would return the sketch
that you're editing.

-Brian

"Kent Keller" wrote in message
news:98E1C23839A4BFE5018D0250A07EB210@in.WebX.maYIadrTaRb...
> If I have a IAM open and activate a component, how do I get access to that
> component with the API?
>
> In other words, I want to activate a part in a assembly, and then modify
> that part with a program.
>
> It seems like it should be something like
> ThisApplication.ActiveDocument.ActiveComponent
>
> Is it possible?
>
> --
> Kent Keller
> Member of the Autodesk Discussion Forum Moderator Program
>
>
>
>
0 Likes