Select lines by Layer Ilogic

Select lines by Layer Ilogic

jvalenzuela
Participant Participant
1,673 Views
10 Replies
Message 1 of 11

Select lines by Layer Ilogic

jvalenzuela
Participant
Participant

Hi, is there any method to select lines by layer using ilogic? 

 

Thanks in advance

0 Likes
Accepted solutions (1)
1,674 Views
10 Replies
Replies (10)
Message 2 of 11

bradeneuropeArthur
Mentor
Mentor
What lines?

sketches in the model.
Sketches in the drawing.
Sketches in the drawing view.
Model lines the drawing view.
Model sketche lines the drawing view.

Please let me know

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 11

jvalenzuela
Participant
Participant

Sorry for the lack of information, the idea is to select only the lines of a certain layer of the model in the drawing view, I searched the forum and the internet but nothing.

 

Thanks for the quick response

0 Likes
Message 4 of 11

bradeneuropeArthur
Mentor
Mentor

Hi,

 

What would you like to do with these lines of that specific layer?

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 11

jvalenzuela
Participant
Participant

The idea is selecting all the lines in a certain layer to change it to another, but by means of ilogic

0 Likes
Message 6 of 11

bradeneuropeArthur
Mentor
Mentor
Hi.

I am writing something thst seems to work.

You will see this Soon.
Ok?

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 11

jvalenzuela
Participant
Participant

Thanks for Your reply

0 Likes
Message 8 of 11

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hi,

 

Check This for VBA:

 

Public Sub l()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument

Dim s As Sheet
Set s = b.Sheets.Item(1)

Dim v As DrawingView
Set v = s.DrawingViews.Item(1)

Dim sl As DrawingCurve
Dim sg As DrawingCurveSegment

For Each sl In v.DrawingCurves

For Each sg In sl.Segments

Dim lay As Layer
Set lay = b.StylesManager.Layers.Item("YOUR LAYER NAME TO BE REPLACE WITH")

If sg.Layer.Name = "YOUR LAYER NAME TO BE REPLACE" Then

sg.Layer = lay

End If

Next
Next


End Sub

 

this For I-logic:

 

 

Public Sub Main()

Dim a As Application
a = ThisApplication

Dim b As DrawingDocument
b = a.ActiveDocument

Dim s As Sheet
s = b.Sheets.Item(1)

Dim v As DrawingView
v = s.DrawingViews.Item(1)

Dim sl As DrawingCurve
Dim sg As DrawingCurveSegment

For Each sl In v.DrawingCurves

For Each sg In sl.Segments

Dim lay As Layer
lay = b.StylesManager.Layers.Item("YOUR LAYER NAME TO BE REPLACE WITH")

If sg.Layer.Name = "YOUR LAYER NAME TO BE REPLACE" Then

sg.Layer = lay

End If

Next
Next


End Sub

Regards, 

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 9 of 11

jvalenzuela
Participant
Participant

Thanks, I only have add an error handling between two next at the end, but works really fine.

0 Likes
Message 10 of 11

bradeneuropeArthur
Mentor
Mentor

That was a good idea to implement that. I do that normally too, but to provide some solutions I never do that to keep it quick and easy to understand.

Thst is also why the declarations are simple dim a as...

Good to hear that it is solved.

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 11 of 11

dseelbach
Participant
Participant

Anyone know why this doesn't work on section views?

 

"Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))"

0 Likes