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: 

How to edit an exisitng sketch using the API

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
gert-leonvanlier
569 Views, 3 Replies

How to edit an exisitng sketch using the API

gert-leonvanlier
Collaborator
Collaborator

I want to edit an exisitng sketch called "SketchSupportPositions". I have found several examples on how to create a new sketch, but that is not what I need. Can anyone give me an example on how to get my existing sketch?

0 Likes

How to edit an exisitng sketch using the API

I want to edit an exisitng sketch called "SketchSupportPositions". I have found several examples on how to create a new sketch, but that is not what I need. Can anyone give me an example on how to get my existing sketch?

Labels (2)
3 REPLIES 3
Message 2 of 4

dutt.thakar
Collaborator
Collaborator
Accepted solution

@gert-leonvanlier 

 

Try this to reach in edit state of the sketch

 

Dim oDef As PartComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
		Dim oSketch As PlanarSketch = oDef.Sketches("SketchSupportPositions")
oSketch.Edit

To exit the edit state of a sketch

 

oSketch.ExitEdit

Hope this will be helpful.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes

@gert-leonvanlier 

 

Try this to reach in edit state of the sketch

 

Dim oDef As PartComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
		Dim oSketch As PlanarSketch = oDef.Sketches("SketchSupportPositions")
oSketch.Edit

To exit the edit state of a sketch

 

oSketch.ExitEdit

Hope this will be helpful.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 3 of 4

bhavik4244
Collaborator
Collaborator

@gert-leonvanlier 

This could help you,

 

Dim oPartDoc As PartDocument
Dim oTG As TransientGeometry
Dim oSketch As PlanarSketch

oPartDoc = ThisApplication.ActiveDocument
oTG = ThisApplication.TransientGeometry

oSketch = oPartDoc.ComponentDefinition.Sketches(1)
MessageBox.Show(oSketch.Name, "Title")

oSketch.Edit

Bhavik Suthar
0 Likes

@gert-leonvanlier 

This could help you,

 

Dim oPartDoc As PartDocument
Dim oTG As TransientGeometry
Dim oSketch As PlanarSketch

oPartDoc = ThisApplication.ActiveDocument
oTG = ThisApplication.TransientGeometry

oSketch = oPartDoc.ComponentDefinition.Sketches(1)
MessageBox.Show(oSketch.Name, "Title")

oSketch.Edit

Bhavik Suthar
Message 4 of 4

gert-leonvanlier
Collaborator
Collaborator

@dutt.thakar wrote:

@gert-leonvanlier 

 

Try this to reach in edit state of the sketch

 

Dim oDef As PartComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
		Dim oSketch As PlanarSketch = oDef.Sketches("SketchSupportPositions")
oSketch.Edit

To exit the edit state of a sketch

 

oSketch.ExitEdit

Hope this will be helpful.


This works! Thank you.

0 Likes


@dutt.thakar wrote:

@gert-leonvanlier 

 

Try this to reach in edit state of the sketch

 

Dim oDef As PartComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
		Dim oSketch As PlanarSketch = oDef.Sketches("SketchSupportPositions")
oSketch.Edit

To exit the edit state of a sketch

 

oSketch.ExitEdit

Hope this will be helpful.


This works! Thank you.

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

Post to forums  

Autodesk Design & Make Report