Overwrite Line Type of DrawingCurveSegment

Overwrite Line Type of DrawingCurveSegment

C_Haines_ENG
Collaborator Collaborator
394 Views
4 Replies
Message 1 of 5

Overwrite Line Type of DrawingCurveSegment

C_Haines_ENG
Collaborator
Collaborator

I cant find how to overwrite the linetype of a line to a custom linetype I have created. I tried to follow the hints but it doesnt seem to work. 

 

oCurve.GetCustomLineType("HIDDEN_V2","Hidden_V2 ____ ____ ____ ____ ____ ____ ____")

 

That is the code im using, I have looked far and wide on the forms and noboby ever seems to have done this.

0 Likes
Accepted solutions (2)
395 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

Does this help?

 

Public Sub Main
	
	Try
		Dim a As Inventor.DrawingDocument = ThisDrawing.Document
	Dim b As Inventor.DrawingCurveSegment
Do While True
	Dim f As Inventor.SelectionFilterEnum = Inventor.SelectionFilterEnum.kDrawingCurveSegmentFilter
	b = ThisApplication.CommandManager.Pick(f, "Pick a Drawing View curve")

	Dim l As Inventor.DrawingStylesManager = a.StylesManager' ThisApplication.StylesManager
For Each ls As Inventor.Layer In l.Layers
	'MsgBox (ls.Name)
	Next
	'Dim la As Inventor.Layer = l.Layers.Item("1:02")
	Dim la As Inventor.Layer = l.Layers.Item("02")

	b.Layer = la

	If b Is Nothing Then
		Exit Do
		End If
	Loop
		Catch
			End Try
	
	End Sub

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 5

WCrihfield
Mentor
Mentor

Actually this time you may need to go up a step.  The DrawingCurveSegment has the Layer property, but the DrawingCurve has the LineType & LineWeight property that you can set.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor
Accepted solution

Also, just in case you did not already know, the DrawingCurve.GetCustomLineType method requires you to create those two 'input' variables ahead of time, with no values set to them yet, then that method will fill in the values for you to those variables.  Then the DrawingCurve.SetCustomLineType() method requires you to input the full file name of the line types file to reference, then the name of the line type, then a Boolean indicating whether to replace an existing line type.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

C_Haines_ENG
Collaborator
Collaborator
Accepted solution

SetCustomLineType did the trick

 

oCurve.SetCustomLineType("FILE PATH","HIDDEN_V2",True)
0 Likes