查看单个帖子
旧 2009-04-13, 09:46 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】code for showhide or delete bom qty column

code for show/hide or delete bom qty column?
part of one of my macros resizes the bom table. i have tried to get it to add or delete the quantity column in the bom. without the api you can hide and show the qty column but can not delete it. in the api i haven't been able to find the code to hide or show it and the code to delete the columns will not delete the qty column.
i have added a sample macro that will find the bom on a sw sheet and after finding it will delete columns and change the title of a column. but it will not delete the quantity column. does anyone know the code hide and show the column?
dan miel
sw sp4
hi dan,
look at my code-sniplet which shows how i empty a column of my bom.
you also can manipulate the colums with the swtable-object (delete colum, hide column and so on)
swfeat = swmodel.firstfeature
do while not swfeat is nothing
if "bomfeat" = swfeat.gettypename then
swbomfeat = swfeat.getspecificfeature2
vtablearr = swbomfeat.gettableannotations
for each vtable in vtablearr
swtable = vtable
icol = swtable.columncount
irow = swtable.rowcount
for i = 0 to irow - 1
swtable.text(i, 3) = " "
next i
exit while
'nsplitdir = swtable.getsplitinformation(nindex, ncount, nstart, nend)
next vtable
end if
swfeat = swfeat.getnextfeature
loop
end while
hope i could help,
hg
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)