'Deleted Parameter Problem

'Deleted Parameter Problem

Anonymous
Not applicable
1,483 Views
10 Replies
Message 1 of 11

'Deleted Parameter Problem

Anonymous
Not applicable

Hi everyone,

 

When i deleted one parameter(let's say myparam), on top of the rules which includes this parameters appears:

 

myparam = False'deleted parameter

After that when i add this parameter i have to get into rule and delete this line for each rule. 

 

Is there any way to prevent this  ?

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

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Could you please share your code.

 

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

0 Likes
Message 3 of 11

Anonymous
Not applicable

Hi, 

 

Here is one of the rules:

 

Kaplama1 =False'deleted parameter (THIS IS THE LINE WHICH APPEARS AUTOMATICALLY, IF I DELETE THE USER PARAMETER Kaplama1)

If
Kaplama1 = True Dim oDrawDoc As DrawingDocument = ThisDrawing.Document ' Obtain a reference to the desired sketched symbol definition. Dim oSketchedSymbolDef As SketchedSymbolDefinition _ = oDrawDoc.SketchedSymbolDefinitions.Item("ElektrolitikÇinkoBağEl") Dim oSheet As Sheet = oDrawDoc.ActiveSheet 'create insertion point, coordinates - in cm ! Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(0.8,0.8) Dim oSketchedSymbol As SketchedSymbol _ = oSheet.SketchedSymbols.Add( _ oSketchedSymbolDef, _ oInsertionPoint, _ 0, 1, Nothing) Else Dim oDrawDoc As DrawingDocument oDrawDoc = ThisDoc.Document For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols If oSymbol.Name = "ElektrolitikÇinkoBağEl" Then oSymbol.Delete End If Next End If

 

0 Likes
Message 4 of 11

Anonymous
Not applicable

This is another one to clear all parameters. I don't think that it's because of the rule itself.

 

BTW all parameters are key.

 

Kaplama1 = False
Kaplama2=False
Kaplama3=False
Kaplama4=False
Kaplama5=False
Kaplama6 = False
KaplamaSonrası=False
Boya1=False
Boya2=False
Boya3=False
Boya4 = False
Boya5= False
Kaynak=False
Montaj=False
İsleme=False
Pah1=False
Pah2=False
Pah3=False
Pah4=False
Sertlik1=False
Sertlik2 = False
UpdateWhenDone =True

 

0 Likes
Message 5 of 11

bradeneuropeArthur
Mentor
Mentor

try this:

 

If Parameter(Kaplama1) = True
		Dim oDrawDoc As DrawingDocument = ThisDrawing.Document
 
' Obtain a reference to the desired sketched symbol definition.
		Dim oSketchedSymbolDef As SketchedSymbolDefinition _
       = oDrawDoc.SketchedSymbolDefinitions.Item("ElektrolitikÇinkoBağEl")
 
		Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 
'create insertion point, coordinates - in cm !
		Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
		Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(0.8,0.8)

		Dim oSketchedSymbol As SketchedSymbol _
       = oSheet.SketchedSymbols.Add( _
             oSketchedSymbolDef, _
             oInsertionPoint, _
             0, 1, Nothing)

Else 
	Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

	For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols

	If oSymbol.Name = "ElektrolitikÇinkoBağEl" Then
		oSymbol.Delete
	End If
Next 
End If

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

Anonymous
Not applicable

I changed the rule, after that deleted parameter and open the rule again and result is same:

 

Screenshot_2.png

0 Likes
Message 7 of 11

bradeneuropeArthur
Mentor
Mentor

I see...

 

Try it this way:

Try
	p = Parameter.Param("Kaplama1")
	Dim oDrawDoc As DrawingDocument = ThisDrawing.Document

' Obtain a reference to the desired sketched symbol definition.
		Dim oSketchedSymbolDef As SketchedSymbolDefinition _
       = oDrawDoc.SketchedSymbolDefinitions.Item("ElektrolitikÇinkoBağEl")
 
		Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 
'create insertion point, coordinates - in cm !
		Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
		Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(0.8,0.8)

		Dim oSketchedSymbol As SketchedSymbol _
       = oSheet.SketchedSymbols.Add( _
             oSketchedSymbolDef, _
             oInsertionPoint, _
             0, 1, Nothing)
	Catch
		MsgBox (False)
	Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

	For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols

	If oSymbol.Name = "ElektrolitikÇinkoBağEl" Then
		oSymbol.Delete
	End If
Next 
		End Try
		

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

Anonymous
Not applicable

Hi,

 

It didn't appear but code is not working correctly. As you understand, code was placing sketch symbol into the drawing with only checkbox but not anymore. 

 

Screenshot_3.png

0 Likes
Message 9 of 11

Anonymous
Not applicable

It is also adding sketch symbol no matter true or false, if i run the rule manually.

0 Likes
Message 10 of 11

Anonymous
Not applicable

Hi,

 

If i switched my first line from

 

If Kaplama1 = True

 

To: 

If Parameter("Kaplama1") = True

 'deleted parameter line don't appears however, code is not working directly with checkbox. I think i have to add another rule to execute all other rules.

 

Here is where i found the solution: https://forums.autodesk.com/t5/inventor-forum/deleted-parameter-remains-in-code/td-p/5236733

0 Likes
Message 11 of 11

Anonymous
Not applicable
Accepted solution

This is the final code which is not working with directly check box. I have to execute with run rule.

 

If Parameter("Kaplama1") = True
		Dim oDrawDoc As DrawingDocument = ThisDrawing.Document
			'Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document
'To make sure that code is adding just one sketch symbol.
	For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols

	If oSymbol.Name = "ElektrolitikÇinkoBağEl" Then
		oSymbol.Delete
	End If
	Next  
' Obtain a reference to the desired sketched symbol definition.
		Dim oSketchedSymbolDef As SketchedSymbolDefinition _
       = oDrawDoc.SketchedSymbolDefinitions.Item("ElektrolitikÇinkoBağEl")
 
		Dim oSheet As Sheet = oDrawDoc.ActiveSheet
 
'create insertion point, coordinates - in cm !
		Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
		Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(0.8,0.8)

		Dim oSketchedSymbol As SketchedSymbol _
       = oSheet.SketchedSymbols.Add( _
             oSketchedSymbolDef, _
             oInsertionPoint, _
             0, 1, Nothing)

Else 
	Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

	For Each oSymbol In oDrawDoc.ActiveSheet.SketchedSymbols

	If oSymbol.Name = "ElektrolitikÇinkoBağEl" Then
		oSymbol.Delete
	End If
Next 
End If