Create user define parameters in part

I’ve read the manual Macro.doc but still no luck.

Any advice, thank you

@Petrnejedly

HI

You don’t know enough about it.

[vxFormItemGet,form_name,field_id,item,isOn,data] #窗体条目获取1
[vxGet,form_name,field_id,item,isOn,data] #窗体条目获取2

This table operation involves algorithms, this information is missing, I have been looking for the old version of the vx installation package, looking for traces, but did not find, then I found the reason myself,

OK, I will try it…

I have second problem. If I run the code below twice the “upade on save” value is overwrite… I mean that check and uncheck…

Is there any function to prevent this?

[vxSend,"$SF=UiPartAt"]
[vxSendEvt,“UiPartAt”,1000,3,2]
[vxSendEvt,“UiPartAt”,73,1,2,"|Enter"]
[vxSendEvt,“UiPartAt”,72,1,2,"|Enter"]
[vxSendEvt,“UiPartAt”,120,4,2]
[vxSendEvt,“UiPartAt”,120,2,2]

image

@Petrnejedly
HI
:point_down: code :point_down:

# Author - 金州锅锅
# Date - 2024/7/1
# Version - 29
# Description 
MACRO main
[vxSend,"$SF=UiPartAt"]
[vxSendEvt,"UiPartAt",1000,3,2]
# 保存数据时更新
[vxFormItemActive,"UiPartAt",73,item] #窗体内容判断
	IF (item=0)
		[Print,"Active:",item]
		[Print,"NO"]
	ELSE
		[Print,"Active:",item]
		[Print,"YES"]
	ENDIF
	IF !(item=1)
		[vxSendEvt,"UiPartAt",73,1,2] 
		[Print,"====OK"]
	ELSE
		[Print,"========>OK"]
	ENDIF	
[vxSendEvt,"UiPartAt",72,1,2]
[vxSendEvt,"UiPartAt",120,2,2]
ENDMACRO

Thank you very much, it works perfectly.

Hello,
I am trying to use API for crate macro for user parameters but…

In the reference is these example

//suppose that there is an expression named "aaa" in active part.

strcpy_s(attributes[1].name, sizeof(attributes[1].name), "str1");

attributes[1].[type](structszw_user_attribute_ace4c7203fba15a940781e058b16029a8.html%22%20%5Cl%20%22ace4c7203fba15a940781e058b16029a8) = [ZW_USER_ATTRIBUTE_STRING](group___zw_basic_data_gad4dff9862a9d5a44d771a07571cc29c1.html%22%20%5Cl%20%22ggad4dff9862a9d5a44d771a07571cc29c1afebf4975bdee77d642928087b0779f1e);

strcpy_s(attributes[1].uzwsubAttribute.szwStringAttribute.value, sizeof([zwString512](group__zwapi__util_gaf0ce0f9ae4a97081f7d831fe88cc2863.html%22%20%5Cl%20%22gaf0ce0f9ae4a97081f7d831fe88cc2863)), "[$aaa]");

Function szwStringAttribute it shoud be in zwapi_attribute.h but there is missing.