matteoluigi
-
Posts
460 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by matteoluigi
-
-
😞 that didn't help
I just want to prevent, that the worksheet already exists before I create a new one 😉
for a in range (4): # vs.CreateWS('WS_TEST'+a+',2,2') worksheet = vs.GetObject(vs.Concat('WS_TEST',a)) if worksheet not in [None, 0]: vs.CreateWS((vs.Concat('WS_TEST',a)),2,2) vs.SetWSColumnWidth((vs.Concat('WS_TEST',a)),1,1,50) vs.SetWSColumnWidth((vs.Concat('WS_TEST',a)),1,1,20) vs.SetWSRowHeight((vs.Concat('WS_TEST',a)),1,1,20,0,0) vs.SetWSRowHeight((vs.Concat('WS_TEST',a)),2,2,20,0,0) vs.SetWSCellFormulaN((vs.Concat('WS_TEST',a)),1,1,1,1,a)
-
did you find any conclusion?
actually I tried the following code, understanding that it won't work.
However, I want to check wether the worksheet already exists before I create it.
if worksheet = nil: however doesn't work with a handle, obviously (and "NIL" doesn't exist in Python)
What can I do?
switch back to Vectorscript? 😞
worksheet = vs.GetObject('WS_TEST') if worksheet = nil: vs.CreateWS(('WS_TEST'),2,2)
-
yeah, now i digged out that script, too.
Incredible somehow, that there is no "find and replace"-command in Vectorworks-Worksheets ;-D.
Like Excel without find-replace...
such a pity, that you can't find & replace sub-rows (unfortunately technically unthinkable, imho)
- 2
-
# this script reads out ther first column of a worksheet # in the first column are written all worksheet names which you might want to recalculate # so you can create more worksheets like more sets of worksheets to recalculate (like publisher sets in VW are possible, too) WSSet = vs.StrDialog(‘Which set of worksheets do you want to recalculate: ‘,’’); # for loop, which reads out the first column of the "recalculate set" for row in range (1,10): WSSetH = vs.GetObject(WSSet) WSName=vs.GetWSCellFormulaN(WSSetH, row, 1) # yes, it works ;-) WSNameH = vs.GetObject(WSName) # recalculate a Worksheet vs.RecalculateWS(WSNameH)
- 1
-
I tried a little Python script for that issue
(this script recommends at least one worksheet with a series of worksheet names which you want to recalculate in the actual file)
# this script reads out ther first column of a worksheet # in the first column are written all worksheet names which you might want to recalculate # so you can create more worksheets like more sets of worksheets to recalculate (like publisher sets in VW are possible, too) WSSet = vs.StrDialog(‘Which set of worksheets do you want to recalculate: ‘,’’); # for loop, which reads out the first column of the "recalculate set" for row in range (1,10): WSSetH = vs.GetObject(WSSet) formula=vs.GetWSCellFormulaN(WSSetH, row, 1) # maybe "WSName=vs.GetWSCellFormulaN(WSSetH, row, 1)" works, too WSName=formula WSNameH = vs.GetObject(WSName) # recalculate a Worksheet vs.RecalculateWS(WSNameH)
- 1
-
ne, es irgendwoanders zwischenzuparken half leider nicht...
-
Hi,
a colleague does have problems pasting text from adobe reader 2021.011.20039 in VW 2021 SP5.
He uses macOS 10.14 on a late 2015 27" iMac with 16GB of ram.
(as you can see in the screenshot) the pasted text gets scattered somehow in pieces after copying it from a pdf and pasting it in a document.
Any experiences?
- 1
-
Hi,
every time I try to switch from one field to the other in the Object Info Palette and switch over a radio button or a drop down menu using the tab key the cursor switches to the measure palette next to the cursor (in german it's called "Objektmaßanzeige/OMA).
that sucks! 😉
PLEASE STOP IT! (last tested in VW 2022 SP2 Build 627588 on macOS 11, MB Pro 16")
-
-
@helleMOMENTE addressing sub-rows with GetWSCellString isn’t possible, right?
-
In Python:
Stringvariable =vs.WSScript_GetPrmStr(index) for getting a String variable,…..
DoesWSScript_SetResStr(resultCellValue) return the value?
-
Hi,
actually I am looking for some help how to make a script run within a Vectorworks worksheet.
Actually I know a little about scripting (both Vectorscript and Python) and what I am doing is simple data processing, which doesn't work in worksheets for several reasons.
I actually wrote some scripts, which for example count space objects and sum up their are, in order to recalculate it in a new worksheet. However running scripts inside the datamanager sounds quite appealing, so it could be worth a try.
Now my simple idea has been, that either if I work in a worksheet or the datamanager, the system must be quite similar
1) in a worksheet for example I create a filter line, which shows me for example all space objects in the drawing or in a specific layer. In Column A I write ='Space'.'11_Occupancy Type' in order to see the text in the corresponding space object record format field. Now I want to hand over that text to a script in column B in order to do whatever I could do with the string from column A. Divide it into substrings, count all Space objects with the corresponding occupancy type and calculate their are,... (sounds quite like it could be possible within the worksheet, but, what I want to achieve goes a little bit further) however
a) where can I define that I want to hand over the string from the worksheet cells A-1.1 -> A1.X?
b) how do catch that string within the script
c) and finally, how do I hand it over back to the worksheet?
2) same about the Datamanager. Let's say, I create a new mapping, which reads out the occupancy type of all space objects and has to count all space objects of the corresponding occupancy type and map the result into a "ifc data field".
thanks in advance for your answers.
The developer reference was a little bit to short. I didn't find the answer there, unfortunately.
-
... sorry for the quick post..., sounds like the datamanager-function must be the same like the worksheet-runscript-function 🙊
Now hoping to find sth in the python or vectorscript-board
-
Hi,
I want to use a (potentially python) script within the vw 2022 Datamanager.
I don't understand, how to tell, which parameters are handed over from the datamanager to the script and vice versa.
I want to read out " 'Space'.'11_Occupancy Type'" in order to count how many rooms the apartment xy does have and how big it is (square meters).
That's the quick help text which doesn't really help me a lot:
QuoteDatabase header cell:
=RunScript('My Script') executes the VectorScript script named “My Script” and returns a value for each object in the databaseSpreadsheet cell:
=RunScript(2, 'ScriptFile.py', 2, 1) executes the Python script “ScriptFile.py” in the Vectorworks Plug-Ins folder, passing the parameters “2” and “1,” and returns a value
-
6 minutes ago, Nikolay Zhelyazkov said:
You can use worksheets to get such information and put them on the drawing as shown in the attached file.
yes, but worksheets actually can't solve what I want to do.
I want to count how many apartments of which entire netto size and of which room number I have.
I still didn't find, how to solve that in a worksheet without some "customizations" (Scripts)
At all, a worksheet can count how many rooms every aparmtent has and how many square meters it has, too.
If I want to count how many aparments of which type a bulding contains, I still have to re refer on space objects. So, writing the room number in a space object, for example with a data tag could be the solution. So, the only reason for that limitation imho could be a performance issue.
-
Well, the Substring thing in fact wasn't my main Idea, however it was worth a try... And, I made it work 🙂
#WS_TEILSTRING('Space'.'11_Occupancy Type'; '_'; 2)# (TEILSTRING is the German command for SUBSTRING 😉 )
my next try is a little bit more advanced, and @Antonio Landsberger from ComputerWorks Germany already told me, that it won't work, and he already placed an Enhancement/Improvement Request (in Jira or somehwere else..., dunno)
I want a Data Tag which counts the number of Space Objects with the same Flat/Apartment ID.
So I know, how many rooms a flat/apartment does have and how many square meters. I already did sth similar with a vectorscript and python script but, running that script takes about 4-10 Minutes, every time (of course dependent of the project size). So I thought solving sth like this with a Data Tag could be a smart way...
(in fact I would have to count the number of rooms, which are either a living, sleeping or working room, but that's more a question of an if query 😉 )
However, it's just another aproach, also for getting more and more familiar with the new data tag tool...
(I tried counting Spaces with "#WS_ANZAHL('Space'.'11_Occupancy Type')#" (Anzahl of course is the command for counting objects.)
Thanks in advance.
-
Hi,
are there any possibilities to implement a substring and a count function in a VW 2022 Data Tag? Both are worksheet functions, however I didn't find them both in the data tag functions. (I suppose, because the "data tag" Plugin doesn't support them there) typing a substring command manually still didn't work.
-
imo we need a datamanager subforum here, the complexity of code increased since vw2022 a lot, it's neither 100% Vectorscript, nor Python (more VS but, too specific imho, many VS guys never get in touch with the datamanager however..., although it COULD BECOME a mighty tool for everybody, event designers included...)
-
Just now, zoomer said:
I will watch the video .....
it's the third Video from 3, however it's the most interesting, imho
-
Just now, zoomer said:
But I thought IFC 4 would have some interesting new features, for Materials and such.
here Tina Draller talks about IFC 4 in the Datamanager, unfortunately in german 😉
- 1
-
19 hours ago, zoomer said:
That's the way I experienced.
I asked for this too, some time ago.
hm, damn
-
Hi,
is there any possibilty to migrate a Datamanager Set from IFC 2x3 to IFC 4? I imagine, that I have to do that job manually, am I wright? 😉
- 1
-
23 hours ago, matteoluigi said:
=Concat
i finally made it. The command "TEXTJOIN" worked. Might sound a little bit weird for Vectorscript.
At all, I only did post here, because I didn't know where else and I've been afraid that in the "Troubleshooting"-Board nobody really is interested in the datamanager...
-
Hi,
I actually am trying to code more complex things in the 2022 Datamanager. Sth like, "concatenate" the wall type.
first part should scan of which material the wall is made, which we actually write in the wall style name. second part is sth like "is it a wall or what is it really? (also written in the style name) and last but not least wether it's an external or an internal wall.
The result should look like:
=Concat(IF(((Style.'Name')='*STB*');'Concrete';'other material');' wall ';(((Style.'Name')='*-A*');'external';'internal'))
however the datamanager returns me bracket and comma-errors.
First of all, is it now possible to concatenate a datamanager-mapping the way I describe it here, and, what could I do better?
And, which forum could be better for issues like that? 😉
I am afraid of getting no answer in the troubleshooting-board...
thanks in advance!!!
VLookup, XLookup in Vectorscript, Python?
in Vectorscript
Posted
Just a quick idea, afaik both functions only exist in worksheets and the 2022 Datamanager.
Why not enable VLookup and XLookup functions also in Vectorscript/Python?
Could be great... I already could have a use case for that...