James Goode

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 46 total)
  • Author
    Posts
  • in reply to: Write text file to embedded library #4300
    James Goode
    Participant

    Is it possible for me to output the symb_pos_x and y without the output being in the 2D script?

    in reply to: Write text file to embedded library #4298
    James Goode
    Participant

    are you able to write to a library from within a pla?

    in reply to: Write text file to embedded library #4297
    James Goode
    Participant

    I’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

    in reply to: Write text file to embedded library #4296
    James Goode
    Participant

    I 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
    in reply to: Write text file to embedded library #4294
    James Goode
    Participant

    I also want to then read that value in a different file

    in reply to: Write text file to embedded library #4293
    James Goode
    Participant

    For 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?

    in reply to: Writing to a text file #4267
    James Goode
    Participant

    I 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?

    in reply to: Writing to a text file #4265
    James Goode
    Participant

    I’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 
    James Goode
    Participant

    Amazing! 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
    James Goode
    Participant

    This seems to work but when I press check script it crashes ArchiCAD every time. Is this some kind of bug?

    James Goode
    Participant

    okay, 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?

    James Goode
    Participant

    hmm, I tried this but it just causes ArchiCAD to crash

    James Goode
    Participant

    This 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

    James Goode
    Participant
    DIM 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!

    in reply to: Properties Controlled by MVO #3969
    James Goode
    Participant

    Thanks 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.

Viewing 15 posts - 31 through 45 (of 46 total)