1981924* 发表于 2017-8-23 09:02:29

UG图框自动填写日期

我看到叶大在这个帖子里面回答了这个方法,但是里面究竟哪个是控制日期的属性就没详细说明了,请问叶大和各位高手可以不吝赐教吗?在下不胜感激涕零

frostorm 发表于 2018-7-31 09:52:43

you could edit the MyMonth expression to insert a conditional expression and change the string to a numeral:



MyMonth=if(subString(MyDate, 5, 7)=="JAN")("01")ELSE IF(subString(MyDate, 5, 7)=="FEB")("02")ELSE IF(subString(MyDate, 5, 7)=="MAR")("03")ELSE IF(subString(MyDate, 5, 7)=="APR")("04")ELSE IF(subString(MyDate, 5, 7)=="MAY")("05")ELSE IF(subString(MyDate, 5, 7)=="JUN")("06")ELSE IF(subString(MyDate, 5, 7)=="JUL")("07")ELSE IF(subString(MyDate, 5, 7)=="AUG")("08")ELSE IF(subString(MyDate, 5, 7)=="SEP")("09")ELSE IF(subString(MyDate, 5, 7)=="OCT")("10")ELSE IF(subString(MyDate, 5, 7)=="NOV")("11")ELSE("12")

frostorm 发表于 2018-7-30 23:25:05

In de expression editor (in modeling -> Ctrl-E) create the following expressions (all type string):

MyDate      = StringUpper(dateTimeString("localTime?", True))
MyDay       = subString(MyDate, 9, 10)
MyMonth   = subString(MyDate, 5, 7)
MyYear      = subString(MyDate, 21, 25)
MyTimeStamp = MyDay + " " + MyMonth + " " + MyYear

Then in Drafting pasted this text into a note: <X0@MyTimeStamp>

我最正经 发表于 2017-8-23 13:18:00

再找一下其他帖子看看

有你世界更美 发表于 2017-8-23 13:45:33

呵呵,不但日期没有那属性的代码,第几页也没有

gxj585 发表于 2017-8-23 15:46:51

有你世界更美 发表于 2017-8-23 13:45
呵呵,不但日期没有那属性的代码,第几页也没有

在模板的时候建模界面做一个日期函数“today”就可以搞定,然后在制图里表格里面选此函数即可

天上* 发表于 2017-8-24 22:30:00

自动日期没有很大用处,有很多工程图都不是一天能出完的,一般都是写一个统一的日期好便于管理。
页: [1]
查看完整版本: UG图框自动填写日期