Skeleton Modeling: Need to Select Sketches from within Window

Skeleton Modeling: Need to Select Sketches from within Window

RoyWickrama_RWEI
Advisor Advisor
780 Views
7 Replies
Message 1 of 8

Skeleton Modeling: Need to Select Sketches from within Window

RoyWickrama_RWEI
Advisor
Advisor

In my skeleton modelling, sometimes, I make all sketches visible (without dimensions visible) with a simple iLogic rule.

 

However, at this point, I need to select some sketches from within the window and make them them invisible. Also, some others to make their dimensions visible.

 

Could someone help me. I look forward to receiving help.

 

 

 

 

0 Likes
Accepted solutions (1)
781 Views
7 Replies
Replies (7)
Message 2 of 8

bradeneuropeArthur
Mentor
Mentor
You can use representations in the part to achieve that. Like sketches on and sketches off.this is a inventor out of the box solution and no coding required.

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 8

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply.

 

This is a master sketch for a very huge assembly modelling. Therefore the sketch has a great many sketches and solid bodes as well. View representation does not help because the sketch (or sketches) need to be invisible and dimensions visible are mostly based on the what I need to do next or editing in general.

 

Rule based solution is ideal.

 

 

Please try to help me.

0 Likes
Message 4 of 8

bradeneuropeArthur
Mentor
Mentor
You want to do something with the selected sketch in the browser only. So kind of right mouse option for this sketch or what di you need?

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 8

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the comment.

 

I basically do not look at browser unless necessary. I look in the window (the graphics in the window): select, edit, look for variable name in the sketch(es), copy to clipboard (if relevant), etc..

This is faster and a lot easier.

0 Likes
Message 6 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support

@RoyWickrama_RWEI,

 

Hoping that below iLogic code would help to select multiple sketches.

 

Dim oSketches As ObjectCollection
Dim oSketch As Inventor.PlanarSketch 

oSketches = ThisApplication.TransientObjects.CreateObjectCollection

While True
	oSketch = ThisApplication.CommandManager.Pick(
		SelectionFilterEnum.kSketchObjectFilter, 
		"Select a sketch to hide") 
		
	' If nothing gets selected then we're done	
	If IsNothing(oSketch) Then Exit While
	
	oSketches.Add(oSketch) 
End While

' If there are selected components we can do something
For Each oSketch In oSketches
	oSketch.visible = False 
Next

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 7 of 8

RoyWickrama_RWEI
Advisor
Advisor

Hi Chandra Shekar;

 

Thanks for the reply.

 

My approach is a little bit different; i.e. I need to select sketch(es) from within window - I hope this is possible!

 

Attached is a sample solid-body sketch. With all the sketches are visible, I may analyse to know what sketch(es) is(are) needed to continue. At this point, I need to have only those sketches are visible.

 

This is very helpful to handle large scale complex master sketch.

 

Request help.

 

0 Likes
Message 8 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@RoyWickrama_RWEI,

 

Thanks for providing sample,

 

Try the following modified iLogic code to hide selected sketche(es).

 

Sub Main()
Dim oDoc As Document
oDoc = ThisDoc.Document    

Dim oVisibility As New ArrayList	
oVisibility.add("ON - ALL SKECHES")			'0-ok	
oVisibility.add("OFF - ALL SKECHES")		'1-ok
oVisibility.add("ON - SELECTED SKECHES")	'2-ok

oVisibility_IP = InputListBox("SELECT FROM ABOVE!", oVisibility, oVisibility.Item(0), "SELECT", "VISIBILITY CONTROL")
'oInput = InputRadioBox("SELECT:", _
' "Turn ON - All", _
' "Turn OFF - ALL", "False", "VISIBILITY CONTROL")
Select Case oVisibility_IP
Case oVisibility(0)	   	
	oVisibility_On()
Case oVisibility(1)	   	
	oVisibility_Off()
Case oVisibility(2)	   	
	oVisibility_SelectedSketches()
End Select

For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
If oWorkPlane.Name = "XY Plane" Then oWorkPlane.Visible = False
If oWorkPlane.Name = "XZ Plane" Then oWorkPlane.Visible = False
If oWorkPlane.Name = "YZ Plane" Then oWorkPlane.Visible = False
Next

iLogicVb.UpdateWhenDone = True
End Sub

Sub oVisibility_On()
Dim oDoc As Document
oDoc = ThisDoc.Document          
    For Each oSketch In oDoc.ComponentDefinition.Sketches
    oSketch.Visible = True
    oSketch.DimensionsVisible = False
    Next
End Sub

Sub oVisibility_Off()
Dim oDoc As Document
oDoc = ThisDoc.Document          
    For Each oSketch In oDoc.ComponentDefinition.Sketches
    oSketch.Visible = False
    oSketch.DimensionsVisible = False
    Next
End Sub

Sub oVisibility_SelectedSketches()

Dim obj As Object
Dim oSketch As Inventor.PlanarSketch

While True
	obj = ThisApplication.CommandManager.Pick(
		SelectionFilterEnum.kSketchDefaultFilter, 
		"Select a sketch to hide")
		On Error Resume Next
		oSketch = obj.Parent 
		oSketch.Visible = False 
	' If nothing gets selected then we're done	
	If IsNothing(obj) Then Exit While	 
End While


End Sub

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network