Jump to content

worksheet database lines created with a script "ignore" the wished criterias


Recommended Posts

I wrote these few lines of script and now i am wondering (not much but a bit) why the database-rows don't work the way I wanted in the created worksheet:

First it turns out the following layout:

That's a little bit "strange" because all WS-database rows are limited to one wallstyle.

Only when I refresh every single database-criteria there's only one wall per database row.

 

Maybe I should switch and concatenate all wallstyles into one criteria line 😉 but, that's the way I did it now.

 

What do you think?

image.thumb.png.26abaf6dca8af166c25eab49214293b0.png


for object_name in object_names:

	object_handle = vs.GetObject(object_name)

	#listentitelzeile = (vs.Concat('=DATENBANK(INCLSUBX & ((T=WAND) & (SPT=', apo, 'Schicht', apo, ') & (','WST=',apo,object_name,apo,')))'))
	listentitelzeile = (vs.Concat('=DATENBANK(T=WAND) & (','WST=',apo,object_name,apo,')'))
	#=DATENBANK(INCLSUBX & ((T=WAND) & (SPT='Schicht') & ("WST='WA-A-TRA-ST-200-MWV-115-MVW-115-476"')))
	vs.SetWSCellFormulaN(WSHandle,row,0,row,0,listentitelzeile)

	#vs.SetWSCellFormulaN(WSHandle,2,0,2,0,"=DATENBANK((T=WAND))")

	vs.SetWSCellFormulaN(WSHandle,row,1,row,1,"=Grafik")
	vs.SetWSImgSize(WSHandle,row,1,row,1,50,50)
	vs.SetWSImgSizeType(WSHandle,row,1,row,1,1)
	vs.SetWSCellFormulaN(WSHandle,row,2,row,2,"=WANDSTIL")
	(boole,object_compNr) = object_componentnr = vs.GetNumberOfComponents(object_handle)
	for comp_nr in range (1,object_compNr+1):
		vs.SetWSCellFormulaN(WSHandle,row,comp_nr+2,row,comp_nr+2,(vs.Concat('=OBJEKTDATEN(',apo,'Schicht',apo,';',apo,'Name',apo,';',apo,comp_nr,apo,')')))
	row = row+1
	

 

create ws script.zip

Edited by matteoluigi
Link to comment
  • matteoluigi changed the title to worksheet database lines created with a script "ignore" the wished criterias

You might need to post this to the German forums instead. There are many lines that will not operate properly in the English version. I tried to do the conversion (DATENBANK -> DATABASE,  T=WAND -> T=WALL, OBJEKTDATEN -> OBJECTDATA), but there were still others that I was unable to find in the time I had available.

 

Sorry.

 

In the original file you posted, the worksheet shows the problem where is reporting all three wall styles even though the criteria is only for one. I have not idea why that is happening and since I can't get the script to run, I can't try and figure out why.

 

Link to comment

OK, I figured it out.

 

listentitelzeile = (vs.Concat('=DATENBANK(T=WAND) & (','WST=',apo,object_name,apo,')'))

 

Notice the parentheses around the criteria.  The way it is written VW is assuming that the criteria is only (T=WAND) [Wall].  Once you open the criteria editor it is seeing both parts and updating appropriately. If you add another set of parenthenses it will work properly.

 

listentitelzeile = (vs.Concat('=DATENBANK((T=WAND) & (','WST=',apo,object_name,apo,'))'))

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...