Forum Replies Created
-
AuthorPosts
-
James GoodeParticipant
Is it possible for me to output the symb_pos_x and y without the output being in the 2D script?
James GoodeParticipantare you able to write to a library from within a pla?
James GoodeParticipantI’ve got it reading and writing correctly but I get error reports saying Cannot modify the file in embedded library in 2D script type, Nonexistent channel and Open error while operating on the file
James GoodeParticipantI can’t seem to get my object to write the symb_pos_x and symb_pos_y to the file at all. My other object can definitely read the file though.
this is my code for OUTPUT
chOUT=OPEN ("TEXT", "SurveyPoint.txt", "separator =' ', MODE=WO, LIBRARY") OUTPUT chOUT, 1, 1, symb_pos_x OUTPUT chOUT, 2, 1, symb_pos_y OUTPUT chOUT, 3, 1, symb_pos_z close chOUT
James GoodeParticipantI also want to then read that value in a different file
James GoodeParticipantFor the object I’m creating, I want to be able to output the symb_pos_x & y of that object. Can that be sent to the embedded library?
James GoodeParticipantI understand that it isn’t a perfect solution but it’s something that may be suitable for what we need. Can you point me in the right direction in terms of my code and why it’s not writing to the file?
James GoodeParticipantI’ve had a go using that as a base but I can’t get my write code to work. Here it is;
ch1 = OPEN ("TEXT", "TEST123", "separator = ' ', MODE = WO") string = "12345" OUTPUT ch1, 1, 0, string
April 19, 2018 at 13:38 in reply to: Possible to use data from external text file as parameters? #4011James GoodeParticipantAmazing! Thanks very much!
Another problem with it…I need it to follow on from the previous j so instead of the EF_20’s, it’s now EF_25 until EF_30 in the same text document. It currently includes all of the EF_20’s and EF_25’s. It does however stop before EF_30 which is great.
I considered using Vardim on refnote to get the amount but I didn’t know how to correctly implement it.
Thanks in advance!
DIM sarray[] var = "" filename = "ProjectNotes.txt" ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY") sarray[j]="" repeat n = INPUT (ch1, j, 1, var) pos = STRSTR (var, "EF_30") if pos # 1 then sarray[j] = var j = j + 1 until pos = 1 or n = -1 CLOSE ch1 VALUES "refnote2" sarray
April 19, 2018 at 11:32 in reply to: Possible to use data from external text file as parameters? #4009James GoodeParticipantThis seems to work but when I press check script it crashes ArchiCAD every time. Is this some kind of bug?
April 19, 2018 at 09:21 in reply to: Possible to use data from external text file as parameters? #4006James GoodeParticipantokay, update. It seems to almost work however it includes the EF_25 line which I don’t want it to include.
Is there a way to exclude this line?April 19, 2018 at 09:19 in reply to: Possible to use data from external text file as parameters? #4005James GoodeParticipanthmm, I tried this but it just causes ArchiCAD to crash
April 18, 2018 at 15:25 in reply to: Possible to use data from external text file as parameters? #4003James GoodeParticipantThis is also a nice solution, you need
until pos = 1
, meaning the string was found at position 1.STRSUB returns the substring from position 1 to pos.
var = prefix
is only true if var is exactly prefix, not longer.I don’t suppose you would be able to give an example would you?
Thanks
April 12, 2018 at 15:18 in reply to: Possible to use data from external text file as parameters? #3992James GoodeParticipantDIM sarray[] var = "" filename = "ProjectNotes.txt" ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY") i = 1 j = 1 y = 1 sarray[j]="" repeat n = INPUT (ch1, y, 1, var) pos = STRSTR (var, "EF-25") L1 = STRSUB (var, 1, pos) sarray[j] = var j=j +1 i=i+1 y=y+1 until var = prefix CLOSE ch1 VALUES "refnote" sarray
This repeats over and over thus causing a crash but I think it’s something along the lines that I am going for. I want it to repeat until one of my lines contains “EF-25” then not include that line. If anyone can help me solve it then I would really appreciate it!
James GoodeParticipantThanks for the reply. I managed to find a work-around where I just select which lines I want to show in the MVO and then select the properties in my zone stamp object.
-
AuthorPosts