Sketchline in respect to assembly

Sketchline in respect to assembly

Cadkunde.nl
Collaborator Collaborator
77 Views
2 Replies
Message 1 of 3

Sketchline in respect to assembly

Cadkunde.nl
Collaborator
Collaborator

Hello Forum,

 

Working with objects and their proxies have always been a challange for me.


Previously I asked how to find the 'native object' from a sketchline you select from a top assembly

 

https://forums.autodesk.com/t5/inventor-programming-ilogic/select-a-sketchline-from-top-assembly-the...

 

Now I'm stuck trying to do the exact opposite

 

 

I have an automation that creates railings on platforms

You select the line:

 

Cadkundenl_0-1753348416082.png

and a railing is created

Cadkundenl_2-1753348465158.png

 

Now I want to find any intersecting lines from the assembly.

Finding this one:

 

Cadkundenl_3-1753349506902.png

 

When I create a platform, I create an object in which I store the 4 sketchlines it's created with.

But these sketchlines are in respect of the place document (an IPT, the green surface)

 

I need them from the respect of the assembly or I can't compare the geometry of them, since one is the X Y Z from its IPT and the other is from the assembly

 

 

Problem in short:

You have a assembly with 1 part

in that part you have 1 sketch with 1 sketchline

 

ilogic:

Dim odoc as partdocument = thisdoc.document

Dim oline as sketchline = odoc.componentdefinition.sketches(1).Sketchlines(1)

 

How to get the proxy of oline from the assembly?

 

 

0 Likes
78 Views
2 Replies
Replies (2)
Message 2 of 3

Cadkunde.nl
Collaborator
Collaborator

My bad

Dim line As SketchLine = edge.line
Dim lineproxy As SketchLineProxy = Nothing
AdjecantPlatform.Occurrence.CreateGeometryProxy(line, lineproxy)

 

Works not only for workgeometry but also perfectly for sketchlines

0 Likes
Message 3 of 3

Andrii_Humeniuk
Advisor
Advisor

Hi @Cadkunde.nl .
I hope I understood your question correctly. You need to get the proxy geometry of a particular sketch line from a particular part. The following iLogic code, as an example, selects the first sketch and the first line on the sketch in the first part:

Dim oADoc As AssemblyDocument = ThisDoc.Document
If oADoc Is Nothing Then Exit Sub
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence = oOccs(1)
Dim oPDef As PartComponentDefinition = oOcc.Definition
Dim oLine As SketchLine = oPDef.Sketches(1).SketchLines(1)
Dim oLineProx As SketchLineProxy = Nothing
Call oOcc.CreateGeometryProxy(oLine, oLineProx)
Call oADoc.SelectSet.Select(oLineProx)

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes