I want to make code to automize the design. I want to import sketch data into VBA (or VB.NET) . Can somebody help me which library does it help this. I want to know the information of lines, length, position etc
This?
Dim oDoc As Document oDoc = ThisApplication.ActiveDocument Dim oPartCompDef As PartComponentDefinition oPartCompDef = oDoc.ComponentDefinition Dim oSketch As Sketch oSketch = oPartCompDef.Sketches.Item(1)
Regards,
FINET L .
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"Can you please explain what you want in more detail? It is a little difficult to understand. It sounds like you are trying to automate something, and to do so you want to gather information about a sketch and/or all the individual entities within a sketch. If so, why? What are you looking for? What are you planning on doing with this data? What kind of end result are you trying to achieve?
Wesley Crihfield
I used this code to import point coordinates but I think I need to read and write to the point by using code.(sketchpoints code can only read ) is there any possible way to interact directly with the inventor and VBA?
Private Sub CommandButton1_Click()
Dim opartDoc As PartDocument
Set opartDoc = ThisApplication.ActiveDocument
Dim opartcompdef As PartComponentDefinition
Set opartcompdef = opartDoc.ComponentDefinition
Dim osketch As Sketch
Set osketch = opartcompdef.Sketches.Item(1)
Dim osketchPoint As SketchPoint
Dim coll_x As New ArrayList
Dim coll_y As New ArrayList
For Each osketchPoint In osketch.SketchPoints
coll_x.Add osketchPoint.Geometry.x
coll_y.Add osketchPoint.Geometry.Y
Next
End Sub
Add a dimention with an user parameter ?
I'm not sure why you need a stand alone application for this.
Regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"I think i need to explain more about it. The above image is beam guideline and node. I wanted to import sketch data into the object( maybe it will be points of the node) and want to control the distance between points by using code. Is there any good way to handle it?( I wanted to make oop program)
Regard
SJ Lim