Can't run rule

Can't run rule

j_weber
Mentor Mentor
318 Views
5 Replies
Message 1 of 6

Can't run rule

j_weber
Mentor
Mentor

Hello everyone,

I don't exactly understand the process

 

I use iLogic to create a parameter in a drawing and then fill it with a multi-list. Before doing this, I check whether the parameter exists in the drawing.

 

oUserParam = ThisApplication.ActiveDocument.Parameters.UserParameters

Try
	oKatType = oUserParam.Item("Kategorie")
Catch
	oKatType = oUserParam.AddByValue("Kategorie","Bauteil", UnitsTypeEnum.kTextUnits)
	MultiValue.SetList("Kategorie", "Bauteil", "Baugruppe", "Presantition", "Zeichnung")
End Try

InventorVb.DocumentUpdate()

 

 

This works quite well so far.

 

Then the current value in the Category parameter is to be written to an Inventor property.

 

iProperties.Value("Summary", "Category") = Kategorie

 

I then have a second rule, which could also be included directly in the first rule.

 

But when I execute the second rule, nothing happens at first. But if I go into the rule editor and back out with Save and Execute, the rule works as I want.

 

I've created a little screencast to show the situation. 

https://autode.sk/3FAlOzP

 

I can't find a way to write the value directly into the property and use it.

 

Can someone perhaps give me a tip?

 

 

 




Jörg Weber
CAD Systemtechniker für AutoCAD, Inventor, Vault





0 Likes
319 Views
5 Replies
Replies (5)
Message 2 of 6

gopinathmY575P
Advocate
Advocate

Hi Try this

 

iProperties.Value("Summary", "Category") = "Hi"
iLogicVb.UpdateWhenDone = True
Message 3 of 6

j_weber
Mentor
Mentor

Hallo @gopinathmY575P 

 

thanks for you replay.

 

I try it but nothing changes. I didn't work




Jörg Weber
CAD Systemtechniker für AutoCAD, Inventor, Vault





0 Likes
Message 4 of 6

mateusz_baczewski
Advocate
Advocate

@j_weber 

Hi,

 

Change:

iProperties.Value("Summary", "Category") = Kategorie

On this:

 

oUserParam = ThisApplication.ActiveDocument.Parameters.UserParameters
Dim oKatValue As String 
Try
	Dim oKatParam As UserParameter = oUserParam.Item("Kategorie")
	oKatValue = oKatParam.Value
Catch
	MsgBox("Parameter not found!")
End Try


iProperties.Value("Summary", "Category") = oKatValue
If you found it helpful, a "Like" would be much appreciated!
If this post solved your problem, please mark it as "Solution.".

0 Likes
Message 5 of 6

j_weber
Mentor
Mentor

Hallo @mateusz_baczewski 

 

thank a lot

That work good. 

 

 




Jörg Weber
CAD Systemtechniker für AutoCAD, Inventor, Vault





Message 6 of 6

mateusz_baczewski
Advocate
Advocate

@j_weber 

 

Glad to hear that! I’d appreciate it if you marked my answer as the solution. 😃

If you found it helpful, a "Like" would be much appreciated!
If this post solved your problem, please mark it as "Solution.".

0 Likes