Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

In-Place Edit fails

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
gilsdorf_e
298 Views, 2 Replies

In-Place Edit fails

Hi, I'm struggeling to run a code that works well for parts, but fails when running on an in-place edited part.

 

Basically it fails when trying to add a sketch with

 

 

PartComponentDefinition.Sketches.Add(selectedPlanarFace, false)

 

 

The workflow would be that the user starts in-place edit of a part component. Then the Inventor Addin is started and asks the user to pick a face. Based on that selection, it creates a planar sketch on this face.

When run directly for the part component everything works well.
When run in-place, I'm getting the ActiveEditDocument. Casting as PartDocument and reading existing sketches from

PartComponentDefinition works well in Debugging. As soon as I try adding a new PlanarSketch with the selected planar face, it will crash with "Wrong parameter".

I suspect that the selected face is somehow in occurence context, so it cannot be used to create a new sketch.

Any ideas, someone?

Labels (2)
2 REPLIES 2
Message 2 of 3
Michael.Navara
in reply to: gilsdorf_e

When you pick the face in assembly context, it is FaceProxy object (not Face object). In this case you can use 

Dim oFace as Face = selectedPlanarFace.NativeObject

 

Message 3 of 3
gilsdorf_e
in reply to: Michael.Navara

Yesss. I was just going to post that is was a proxy issue. Sometimes it helps writing down you issue. Thank you anyways.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report