Any examples of using Workpoints?

Any examples of using Workpoints?

Anonymous
Not applicable
484 Views
4 Replies
Message 1 of 5

Any examples of using Workpoints?

Anonymous
Not applicable
I would like to add a workpoint to a part (manually) for other programming
purposes. Does anyone have any examples of: 1) Programatically naming a
workpoint. 2) Finding the named work point programatically. 3) Making the
named workpoint visible (which I think is something like "workpoint.visible=
true", but I can't find any examples of how to address the desired
workpoint).

Thanks,

Ed
0 Likes
485 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
There's a sample called "Work Point at Mass Center" that's part of the API
help. I think it demonstrates everything you asked about except the
visibility part.
--
Brian Ekins
Autodesk Inventor API Product Designer


"Ed Thompson" wrote in message
news:608ED00C34961C29C49843F7AD93DC39@in.WebX.maYIadrTaRb...
> I would like to add a workpoint to a part (manually) for other programming
> purposes. Does anyone have any examples of: 1) Programatically naming a
> workpoint. 2) Finding the named work point programatically. 3) Making
the
> named workpoint visible (which I think is something like
"workpoint.visible=
> true", but I can't find any examples of how to address the desired
> workpoint).
>
> Thanks,
>
> Ed
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Brian,

Excellent! I see that I didn't look quite close enough at the example.
Thanks!

Ed


"Brian Ekins" wrote in message
news:8F7E53C36154021423E205F8ACDF0330@in.WebX.maYIadrTaRb...
> There's a sample called "Work Point at Mass Center" that's part of the API
> help. I think it demonstrates everything you asked about except the
> visibility part.
> --
> Brian Ekins
> Autodesk Inventor API Product Designer
>
>
> "Ed Thompson" wrote in message
> news:608ED00C34961C29C49843F7AD93DC39@in.WebX.maYIadrTaRb...
> > I would like to add a workpoint to a part (manually) for other
programming
> > purposes. Does anyone have any examples of: 1) Programatically naming
a
> > workpoint. 2) Finding the named work point programatically. 3) Making
> the
> > named workpoint visible (which I think is something like
> "workpoint.visible=
> > true", but I can't find any examples of how to address the desired
> > workpoint).
> >
> > Thanks,
> >
> > Ed
> >
> >
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Brian,

Is if possible in R6 to place a workpoint in an assembly?

I tried the following code, but something is wrong?

Dim Comp As ComponentOccurrence
Set Comp = ThisApplication.ActiveDocument.SelectSet.Item(1)

Dim oWorkPoint As WorkPoint
Set oWorkPoint = Comp.WorkPoints.Item("Test Point")

Thanks,

Ed



"Brian Ekins" wrote in message
news:8F7E53C36154021423E205F8ACDF0330@in.WebX.maYIadrTaRb...
> There's a sample called "Work Point at Mass Center" that's part of the API
> help. I think it demonstrates everything you asked about except the
> visibility part.
> --
> Brian Ekins
> Autodesk Inventor API Product Designer
>
>
> "Ed Thompson" wrote in message
> news:608ED00C34961C29C49843F7AD93DC39@in.WebX.maYIadrTaRb...
> > I would like to add a workpoint to a part (manually) for other
programming
> > purposes. Does anyone have any examples of: 1) Programatically naming
a
> > workpoint. 2) Finding the named work point programatically. 3) Making
> the
> > named workpoint visible (which I think is something like
> "workpoint.visible=
> > true", but I can't find any examples of how to address the desired
> > workpoint).
> >
> > Thanks,
> >
> > Ed
> >
> >
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Hi Ed,

Here's a sample that demonstrates creating work features in an assembly.

Public Sub AssemblyWorkFeatures()
' Get a reference to the assembly component definition.
Dim oCompDef As AssemblyComponentDefinition
Set oCompDef = ThisApplication.ActiveDocument.ComponentDefinition

' Get a reference to the TransientGeometry object.
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry

' Create a work point at (0,0,0)
Dim oWPoint As WorkPoint
Set oWPoint = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(2, 0, 0))
oWPoint.Name = "My WorkPoint"

' Create a work axis through (3,1,0) and along the X axis.
Dim oWAxis As WorkAxis
Set oWAxis = oCompDef.WorkAxes.AddFixed(oTG.CreatePoint(3, 1, 0), _
oTG.CreateUnitVector(1, 0, 0))
oWAxis.Name = "My WorkAxis"

' Create a work plane that passes through (2,2,0) and is
' 45 degrees to the x-z plane.
Dim oWPlane As WorkPlane
Set oWPlane = oCompDef.WorkPlanes.AddFixed(oTG.CreatePoint(2, 2, 0), _
oTG.CreateUnitVector(0, 0, -1),
oTG.CreateUnitVector(-1, -1, 0))
oWPlane.Name = "My WorkPlane"
End Sub

-Brian

"Ed Thompson" wrote in message
news:01AAE77274E35A1DC34C60EA90150C95@in.WebX.maYIadrTaRb...
> Brian,
>
> Is if possible in R6 to place a workpoint in an assembly?
>
> I tried the following code, but something is wrong?
>
> Dim Comp As ComponentOccurrence
> Set Comp = ThisApplication.ActiveDocument.SelectSet.Item(1)
>
> Dim oWorkPoint As WorkPoint
> Set oWorkPoint = Comp.WorkPoints.Item("Test Point")
>
> Thanks,
>
> Ed
>
>
>
> "Brian Ekins" wrote in message
> news:8F7E53C36154021423E205F8ACDF0330@in.WebX.maYIadrTaRb...
> > There's a sample called "Work Point at Mass Center" that's part of the
API
> > help. I think it demonstrates everything you asked about except the
> > visibility part.
> > --
> > Brian Ekins
> > Autodesk Inventor API Product Designer
> >
> >
> > "Ed Thompson" wrote in message
> > news:608ED00C34961C29C49843F7AD93DC39@in.WebX.maYIadrTaRb...
> > > I would like to add a workpoint to a part (manually) for other
> programming
> > > purposes. Does anyone have any examples of: 1) Programatically
naming
> a
> > > workpoint. 2) Finding the named work point programatically. 3)
Making
> > the
> > > named workpoint visible (which I think is something like
> > "workpoint.visible=
> > > true", but I can't find any examples of how to address the desired
> > > workpoint).
> > >
> > > Thanks,
> > >
> > > Ed
> > >
> > >
> >
> >
>
>
0 Likes