- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Importing sketch data to vba
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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"- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
so the first thing we need to do is draw a beam guide line and want to extract the information(beam guideline looks like branches, have right angle) of beam guide node information to the standalone application or VBA because we want to give a beam guide some constraint. (ex, lens equation, gaussian eq, beam size) so I want to know how can I interact with code? and inventor. (Sorry for the poor explanation. It`s hard to explain because this is my first time developing some programs, also VBA is my first time)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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"- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I`m planning to make a standalone application or VBA module to help make a light beam guide board. This is the board that can mount mirrors, filters, lens etc.
so the first thing we need to do is draw a beam guide line and want to extract the information(beam guideline looks like branches, have right angle) of beam guide node information to the standalone application or VBA because we want to give a beam guide some constraint. (ex, lens equation, gaussian eq, beam size) so I want to know how can I interact with code? and inventor. (Sorry for the poor explanation. It`s hard to explain because this is my first time developing some programs, also VBA is my first time)
I just want to import point information and want to handle it by code or some way
Regards
Sung Joo Lim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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