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: 

Howto: close profile

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
636 Views, 6 Replies

Howto: close profile

Could You help me How can I create closed profile in VBA
Suppose this profile includes Line and Spline
See attached code in vb

Later I cannot create Extrude feature because previously
created profile is open (consists of two separate curves)

Could You help me How can I join together points in
profile which belongs to separate curves to get one curve.

I know that this is simple :), but ... I could not find the solution.

Thx for all Your help.
Regards



Dim t As Inventor.TransientGeometry
Set t = ThisApplication.TransientGeometry

Dim c As Inventor.ComponentDefinition
Set c = ThisApplication.ActiveDocument.ComponentDefinition

Dim wpts As Inventor.WorkPoints
Set wpts = c.WorkPoints

Dim wp0 As Inventor.WorkPoint
Set wp0 = wpts.AddFixed(t.CreatePoint(0, 0, 0))

Dim wp1 As Inventor.WorkPoint
Set wp1 = wpts.AddFixed(t.CreatePoint(1, 0, 0))

Dim wp2 As Inventor.WorkPoint
Set wp2 = wpts.AddFixed(t.CreatePoint(0, 1, 0))
wp2.Visible = False

Dim wpls As Inventor.WorkPlanes
Set wpls = c.WorkPlanes
Dim wpl As Inventor.WorkPlane
Set wpl = wpls.AddByThreePoints(wp0, wp1, wp2)
wpl.Visible = False

Dim s As Inventor.PlanarSketch
Set s = c.Sketches.Add(wpl)

Dim oc As ObjectCollection
Set oc = ThisApplication.TransientObjects.CreateObjectCollection
Call oc.Add(t.CreatePoint2d(0, 0))
Call oc.Add(t.CreatePoint2d(1, 0))
Call oc.Add(t.CreatePoint2d(0, 1))

Dim sp As Inventor.SketchSpline
Set sp = s.SketchSplines.Add(oc)
Dim sl As Inventor.SketchLine

Set sl = s.SketchLines.AddByTwoPoints(t.CreatePoint2d(0, 0),
t.CreatePoint2d(0, 1))
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

I haven't tried it with your code, but when you add the line try using the spines
startpoint and endpoint

Something like this maybe?

Set sl = s.SketchLines.AddByTwoPoints(sp.startsketchpoint, sp.endsketchpoing)


--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"jarek" wrote in message
news:F006284CCC9131E23C743FE80B4A9326@in.WebX.maYIadrTaRb...
> Could You help me How can I create closed profile in VBA
> Suppose this profile includes Line and Spline
> See attached code in vb
>
Message 3 of 7
Anonymous
in reply to: Anonymous

I think what you want to do is use the .Merge method to combine the
start and end points, closing the curve.

jarek wrote:

>Could You help me How can I create closed profile in VBA
>Suppose this profile includes Line and Spline
>See attached code in vb
>
>
>
>
Message 4 of 7
Anonymous
in reply to: Anonymous

Hi There

I have exactly the same problem. My profiles also conatain curve. How did you solve this problem?

See attached file for my profile.

Thanks in advance
Irfan
Message 5 of 7
Anonymous
in reply to: Anonymous

Now I have the same problem. Can anybody provide a solution?

 

Thanks.

Message 6 of 7
Anonymous
in reply to: Anonymous

You have to add constrains between the start/endpoints...

I had the same issue too, and that solved my problem.

Message 7 of 7
hithere8
in reply to: Anonymous

Thanks Fred, that worked by adding constraints.

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

Post to forums  

Autodesk Design & Make Report