Create workpoint on assembly geometry

Create workpoint on assembly geometry

David-Truyens
Enthusiast Enthusiast
803 Views
9 Replies
Message 1 of 10

Create workpoint on assembly geometry

David-Truyens
Enthusiast
Enthusiast

Hi,

 

I would like to create a workpoint on a geometry at the assembly level. So not a fixed, but with a constraint to that selected point. Any idea? If I use the Pick with a point filter I just get the coordinates, but not the id of the point itself.

 

Thanks,

David

0 Likes
Accepted solutions (2)
804 Views
9 Replies
Replies (9)
Message 2 of 10

bradeneuropeArthur
Mentor
Mentor

Hoi David,

 

So you need to create a point without directly attached to the geometry, but with constaints to the geometry?

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 10

David-Truyens
Enthusiast
Enthusiast

Hi Brad,

 

What do you mean with "without directly attached"? If you create a workpoint on assembly level and would like it to move with the component it needs a constraint between the workpoint and the geometry as far as I know. If you know another way I'll be glad to learn it!

 

Regards,

David

0 Likes
Message 4 of 10

bradeneuropeArthur
Mentor
Mentor

Hoi David,

 

Maybe I don't understand, but the workpoints are per default constraint as seen bellow:

 

Workpoint.PNG

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 10

David-Truyens
Enthusiast
Enthusiast

Hi Brad,

 

I'm sorry, I should mention that I would like to do this via the API. So you have a "pick" function where you can select a point and then it should create a workpoint on that selected point with a constraint.

0 Likes
Message 6 of 10

bradeneuropeArthur
Mentor
Mentor

Hallo David,

 

I will take a look at this.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 10

bradeneuropeArthur
Mentor
Mentor
Accepted solution

This is how:

 

Public Sub MatePointConstraint()
    ' Set a reference to the assembly component definintion.
    Dim a As Application
Set a = ThisApplication
Dim b As AssemblyDocument
Set b = a.ActiveDocument

Dim c As AssemblyComponentDefinition
Set c = b.ComponentDefinition
Dim p As Point

Dim w As WorkPoint

Set p = ThisApplication.TransientGeometry.CreatePoint(0, 0, 0)
Set w = b.ComponentDefinition.WorkPoints.AddFixed(p, False)

Dim oObject As Object
Dim cmd As CommandManager
Set cmd = ThisApplication.CommandManager

Set oObject = cmd.Pick(kAllPointEntities, "Pick a feature")

    
    Dim oAsmCompDef As AssemblyComponentDefinition
    Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

    ' Set a reference to the select set.
    Dim oSelectSet As SelectSet
    Set oSelectSet = ThisApplication.ActiveDocument.SelectSet

    ' Get the two entities from the select set.
    Dim oBrepEnt1 As WorkPoint
    Dim oBrepEnt2 As Object
    Set oBrepEnt1 = w
    Set oBrepEnt2 = oObject

    ' Create the insert constraint between the parts.
    Dim oMate As MateConstraint
    Set oMate = oAsmCompDef.Constraints.AddMateConstraint(oBrepEnt1, oBrepEnt2, 0)
End Sub

Groetjes,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 8 of 10

David-Truyens
Enthusiast
Enthusiast

Looks good! Didn't have time to test it yet.. I'll make sure I'll do that this week.

 

Regards,

David

 

ps: kennen wij elkaar? 🙂

0 Likes
Message 9 of 10

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hoi David,

 

Sure it works, I have tested in inventor 2018.

 

You will see.

 

De Groeten,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 10

bradeneuropeArthur
Mentor
Mentor

I have send you a short private message.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes