<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LOCK Not Locking! in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102820#M37181</link>
    <description>Or try this one:&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;IF GLOB_CONTEXT=2 THEN&lt;BR /&gt;
PROJECT2 3,270,2&lt;BR /&gt;
ROTx 45 : ROTy 45&lt;BR /&gt;
BLOCK 1,2,3&lt;BR /&gt;
ENDIF
&lt;/BLOCKQUOTE&gt;

Block is visible in 2D, but not in 3D or settings dialog. And it is visible in case the BLOCK-command is &lt;B&gt;after&lt;/B&gt; the PROJECT2-command. Do you see, what I mean?&lt;BR /&gt;
&lt;BR /&gt;
To help with your problem we need to see more of  your code, because the "fault" is not as near to the LOCK-command.</description>
    <pubDate>Tue, 14 Jun 2005 07:02:29 GMT</pubDate>
    <dc:creator>Frank Beister</dc:creator>
    <dc:date>2005-06-14T07:02:29Z</dc:date>
    <item>
      <title>LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102814#M37175</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I have several LOCK functions in my Master Script that are meant to lock parameters depending on other values.  I have at least 3 of them that won't lock the parameter.  I've checked it from every angle -- spelling, punctuation, syntax, order of evaluation, extraneous code, etc. -- and nothing has solved the problem, they just will not lock.  I've spent at least 3 hours trying to solve this problem.&lt;BR /&gt;
&lt;BR /&gt;
The following code is used in a dozen places, only using different parameter names each time.&lt;BR /&gt;
&lt;BR /&gt;
IF DCA_Deadbolt = `-` THEN&lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `-`&lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty`&lt;BR /&gt;
ELSE&lt;BR /&gt;
IF DCA_Deadbolt_Qty = `-` THEN&lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `1`&lt;BR /&gt;
IF TypeChar &amp;lt;&amp;gt; `D` THEN&lt;BR /&gt;
&lt;FONT color="darkred"&gt;PARAMETERS TempVal = "HELLO"&lt;/FONT&gt;  &lt;FONT color="red"&gt;! This line works &lt;/FONT&gt;&lt;BR /&gt;
&lt;FONT color="darkred"&gt;LOCK `DCA_Deadbolt_Qty` &lt;/FONT&gt;&lt;FONT color="red"&gt;! This line DOESN'T &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_evil.gif" style="display : inline;" /&gt; &lt;/FONT&gt;&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
The test line with TempVal works, which tells me the IF function preceeding it is working correctly.  There is absolutely no reason the LOCK function shouldn't work.  Is this a bug, or am I missing something?  I realize it's Friday afternoon, but I can't be THAT delirious.&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jun 2005 22:39:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102814#M37175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-10T22:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102815#M37176</link>
      <description>Have you tried the script in the Parameter Script?</description>
      <pubDate>Sat, 11 Jun 2005 01:39:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102815#M37176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-11T01:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102816#M37177</link>
      <description>try with double and single quotes as well as the back ticks?
&lt;PRE&gt;LOCK "DCA_Deadbolt_Qty"&lt;/PRE&gt;

(by the way - the single, double and back ticks around the parameter value all lock for me . . . .)&lt;BR /&gt;
&lt;BR /&gt;
~/archiben</description>
      <pubDate>Sat, 11 Jun 2005 03:00:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102816#M37177</guid>
      <dc:creator>__archiben</dc:creator>
      <dc:date>2005-06-11T03:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102817#M37178</link>
      <description>PARAMETERS and LOCK should first of all be part of the parameters script. They do not work in all context!&lt;BR /&gt;
&lt;BR /&gt;
Where does TypeChar come from? Maybe TypeChar&amp;lt;&amp;gt;"D" in the moment PARAMETERS works in master and LOCK does not. In a later iteration of the master script, when LOCK would work, maybe TypeChar="D".&lt;BR /&gt;
&lt;BR /&gt;
As I wrote here a few times: The scripts are executed more than once, esp. the MASTER. And not all stements work in each run. So put in the MASTER as far as possible just common expressions, which are necessary for all script types.&lt;BR /&gt;
&lt;BR /&gt;
Have you tried&lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty`&lt;BR /&gt;
without any dependance of another expression?</description>
      <pubDate>Mon, 13 Jun 2005 06:43:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102817#M37178</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-13T06:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102818#M37179</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;Where does TypeChar come from?&lt;/BLOCKQUOTE&gt;
It was defined at the beginning of the Master Script.&lt;BR /&gt;
&lt;BR /&gt;
TypeChar = STRSUB(DCA_Type, 1, 1) !DCA_Type is a string code&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;Maybe TypeChar&amp;lt;&amp;gt;"D" in the moment PARAMETERS works in master and LOCK does not. In a later iteration of the master script, when LOCK would work, maybe TypeChar="D".&lt;/BLOCKQUOTE&gt;

Refer back to my first email.  The line immediately preceeding the LOCK line works exactly as expected.  The LOCK line is ignored.  There are no other LOCK statement after this one, and there are no other LOCK statements in any other script.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;Have you tried&lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty`&lt;BR /&gt;
without any dependance of another expression?&lt;/BLOCKQUOTE&gt;

Yes, I tried it as the very last line in the Master Script and it worked just fine.  The statement LOCK &lt;FONT color="darkred"&gt;`DCA_Deadbolt_Qty`&lt;/FONT&gt; is only used in two other situations, both of which occur before the failing instance, and both of those function properly.&lt;BR /&gt;
&lt;BR /&gt;
My next post (after a meeting I must attend) will include the GDL and an explanation about how to test the faulty line.</description>
      <pubDate>Mon, 13 Jun 2005 19:21:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102818#M37179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-13T19:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102819#M37180</link>
      <description>&lt;BLOCKQUOTE&gt;The line immediately preceeding the LOCK line works exactly as expected. The LOCK line is ignored.&lt;/BLOCKQUOTE&gt;

This I wanted to explain to you. There is no problem with the syntax of your LOCK command. I try it again. Would be easier in German. &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Most commands are allowed in Master-Skript, but they do not work in each context. If they make no sense (from the view of the gdl interpreter) they will be just ignured. Example:&lt;BR /&gt;

&lt;PRE&gt;LINE2 0,0,1,1
BLOCK 1,2,3&lt;/PRE&gt;

Changing to the floor plan view first the master script is executed, then the 2D-Script. The line of the master will be visible, the block, of course, not. In the 3D-window the block, but not the line is visible.&lt;BR /&gt;
&lt;BR /&gt;
Lets modify the script:
&lt;PRE&gt;IF doyouwant="yes" THEN
LINE2 0,0,1,1
BLOCK 1,2,3
ENDIF&lt;/PRE&gt;

Works as well as the first example. Some more:
&lt;PRE&gt;IF GLOB_CONTEXT=2 THEN doyouwant="yes" ELSE doyouwant="no"

! [... anycode]

IF doyouwant="yes" THEN
LINE2 0,0,1,1
BLOCK 1,2,3
ENDIF&lt;/PRE&gt;

Now the block will not be visible anywhere, but the line in 2D.&lt;BR /&gt;
&lt;BR /&gt;
Transferred to your problem:&lt;BR /&gt;
&lt;BR /&gt;
In the moment the PARAMETERS statement is executable in master script  TypeChar is unequal to  "D". In a later execution of the master-script, when the LOCK command would work, TypeChar is equal to  "D" and the line is not executed, because the IF-THEN is not true.&lt;BR /&gt;
&lt;BR /&gt;
The Master-Script is executed many times, before the complete object is calculated. Just in the settings dialog:&lt;BR /&gt;
&lt;BR /&gt;
E.g.:&lt;BR /&gt;
Master &amp;gt; Parameter &amp;gt; parameter-reset &amp;gt; Master &amp;gt; User interface &amp;gt; parameter-reset &amp;gt; Master &amp;gt; 2D-view&lt;BR /&gt;
&lt;BR /&gt;
I am asking GS a long time to give us a list, which parameters do work in which context in the master and how the scripts are executed exactly!&lt;BR /&gt;
&lt;BR /&gt;
P.S. the scripts above are not tested. Maybe there are some minor syntax faults.</description>
      <pubDate>Tue, 14 Jun 2005 06:47:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102819#M37180</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-14T06:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102820#M37181</link>
      <description>Or try this one:&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;IF GLOB_CONTEXT=2 THEN&lt;BR /&gt;
PROJECT2 3,270,2&lt;BR /&gt;
ROTx 45 : ROTy 45&lt;BR /&gt;
BLOCK 1,2,3&lt;BR /&gt;
ENDIF
&lt;/BLOCKQUOTE&gt;

Block is visible in 2D, but not in 3D or settings dialog. And it is visible in case the BLOCK-command is &lt;B&gt;after&lt;/B&gt; the PROJECT2-command. Do you see, what I mean?&lt;BR /&gt;
&lt;BR /&gt;
To help with your problem we need to see more of  your code, because the "fault" is not as near to the LOCK-command.</description>
      <pubDate>Tue, 14 Jun 2005 07:02:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102820#M37181</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-14T07:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102821#M37182</link>
      <description>Wow!  That is interesting (in a painful way)!  I would think that &lt;FONT color="darkred"&gt;TypeChar = STRSUB(DCA_Type, 1, 1)&lt;/FONT&gt; would be set regardless -- it's the first code line in the Master Script.&lt;BR /&gt;
&lt;BR /&gt;
The attached GDL is the problem door.  If you search for &lt;FONT color="darkred"&gt;LOCK PROBLEM&lt;/FONT&gt; you will find one of the offending LOCK lines.  To get the problem to rear it's ugly head, perform the following steps in the Parameters section of the settings dialog:&lt;BR /&gt;
&lt;BR /&gt;
1 - Insert an instance of the door.&lt;BR /&gt;
2 - Open the settings dialog, go to the &lt;FONT color="darkred"&gt;Parameters&lt;/FONT&gt; section and expand the &lt;FONT color="darkred"&gt;DCA Door Parameter&lt;/FONT&gt;s title.&lt;BR /&gt;
3 - Set &lt;FONT color="darkred"&gt;Leaf Material &lt;/FONT&gt;to &lt;FONT color="darkred"&gt;SCWD&lt;/FONT&gt;, and &lt;FONT color="darkred"&gt;Leaf Type &lt;/FONT&gt;to &lt;FONT color="darkred"&gt;NL&lt;/FONT&gt;.&lt;BR /&gt;
4 - Scroll down to Lock Type.  If &lt;FONT color="darkred"&gt;Lock Type &lt;/FONT&gt;is a dash, there is not lock on the door, so the &lt;FONT color="darkred"&gt;Lock Quantity &lt;/FONT&gt;is also a dash &lt;U&gt;&lt;/U&gt;&lt;S&gt;&lt;U&gt;&lt;U&gt;&lt;/U&gt;&lt;/U&gt;&lt;/S&gt;and it is locked.&lt;E&gt;&lt;/E&gt;.  If you choose a &lt;FONT color="darkred"&gt;Lock Type&lt;/FONT&gt;, you automatically have a &lt;FONT color="darkred"&gt;Lock Quantity &lt;/FONT&gt;of &lt;FONT color="darkred"&gt;1&lt;/FONT&gt;.  I want to lock the quantity so the user knows it's the only option.&lt;BR /&gt;
&lt;BR /&gt;
The reason I don't just lock it and leave it is because there is the possibility of a Dutch door being specifed -- which can have up to 2 locks on it.  Wherever you see &lt;FONT color="darkred"&gt;TypeChar = `D`&lt;/FONT&gt; or &lt;FONT color="darkred"&gt;TypeChar &amp;lt;&amp;gt; `D`&lt;/FONT&gt; I'm checking to see if it's a dutch door.&lt;BR /&gt;
&lt;BR /&gt;
It seems pretty simple to me, but what a pain this has been!</description>
      <pubDate>Tue, 14 Jun 2005 14:59:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102821#M37182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T14:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102822#M37183</link>
      <description>Hello Jay&lt;BR /&gt;
&lt;BR /&gt;
I also had big problems with the "Lock" function on several parameters in the Master Script, also on a Door, also with a If Then Statement. &lt;BR /&gt;
Incidentally I have had also had problem with the function "Hideparameter" in Master Script.&lt;BR /&gt;
&lt;BR /&gt;
I have try a lot of things and the only solution which works every time is to have them in the Parameter Script and only there. Same way for "Hideparameter".&lt;BR /&gt;
&lt;BR /&gt;
I can't test your door because I stay in AC81, but I am almost sure that your problem is there…</description>
      <pubDate>Tue, 14 Jun 2005 17:36:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102822#M37183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T17:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102823#M37184</link>
      <description>&lt;BLOCKQUOTE&gt;Fmr wrote:&lt;BR /&gt;...the only solution which works every time is to have them in the Parameter Script and only there.&lt;/BLOCKQUOTE&gt;

I moved all the code that deals with PARAMETERS and LOCK to the Parameter Script -- no luck, it still misbehaves.&lt;BR /&gt;
&lt;BR /&gt;
Thanks anyway!&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure how this squares with DNC's view that most of that stuff should be in the Master Script.  If I understand this thread correctly, the Master Script is run repeatedly, where the Parameter Script is only run in certain instances.  If so, it would seem that you would put it in the Parameter Script for speed, or the Master Script for constant validation.&lt;BR /&gt;
&lt;BR /&gt;
Hmmm...</description>
      <pubDate>Tue, 14 Jun 2005 18:40:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102823#M37184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T18:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102824#M37185</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;In the moment the PARAMETERS statement is executable in master script  TypeChar is unequal to  "D". In a later execution of the master-script, when the LOCK command would work, TypeChar is equal to  "D" and the line is not executed, because the IF-THEN is not true.&lt;/BLOCKQUOTE&gt;

I just tested that idea by putting the value of TypeChar into a test parameter right before attempting the LOCK and TypeChar is being set appropriately.  I tested TypeChar in other situations to make sure it was switching to other appropriate values -- it seems to be working correctly in all scenarios.</description>
      <pubDate>Tue, 14 Jun 2005 19:08:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102824#M37185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T19:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102825#M37186</link>
      <description>&lt;BLOCKQUOTE&gt;I moved all the code that deals with PARAMETERS and LOCK to the Parameter Script -- no luck, it still misbehaves.&lt;/BLOCKQUOTE&gt;

As you mentioned, this does not help for all these problems.&lt;BR /&gt;
&lt;BR /&gt;
I made a short view to your door, but it's too 'blown up' to understand it in a short time. All I can say is: There is too much parameter-script - stuff in the master script. Put all these VALUES into theit right place!&lt;BR /&gt;
&lt;BR /&gt;
Using PARAMETERS in master is sometimes a good move, but first you should try it in the parameter script.&lt;BR /&gt;
In case the PARAMETERS-command is ignored, because the interpreter is in the "wrong" circumstance, the parameter will not be changed either.&lt;BR /&gt;
I prefer:&lt;BR /&gt;
&lt;BR /&gt;
val1="new value"&lt;BR /&gt;
PARAMETERS val1=val1&lt;BR /&gt;
&lt;BR /&gt;
In &lt;A href="http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/LibDevGuide/TechnicalStandards.html#title41" target="_blank"&gt;GDL Technical Standards&lt;/A&gt; is a recommendation to declare parameters in master. This does not mean to put all PARAMETERS-stuff into the master!&lt;BR /&gt;
This means, if e.g. the size of object-part is not adjustable by a parameter but calculated by other parameters and this size is used in 2D and 3D THEN its is useful to declare it in master. You don't have to do it twice.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;I'm not sure how this squares with DNC's view that most of that stuff should be in the Master Script.&lt;/BLOCKQUOTE&gt;

As I said at other places I do not agree in this point with DNC.&lt;BR /&gt;
&lt;BR /&gt;
To transfer to my example above. I split the two lines:&lt;BR /&gt;
&lt;BR /&gt;
! MASTER-Script&lt;BR /&gt;
!&lt;BR /&gt;
val1="new value"&lt;BR /&gt;
&lt;BR /&gt;
! PARAMETER-Script&lt;BR /&gt;
!&lt;BR /&gt;
PARAMETERS val1=val1&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;If I understand this thread correctly, the Master Script is run repeatedly, where the Parameter Script is only run in certain instances. If so, it would seem that you would put it in the Parameter Script for speed, or the Master Script for constant validation.&lt;/BLOCKQUOTE&gt;

In most cases it will not remarkable decrease speed, if there are lots only once executed statements in the master. But you should not put there file access. This  will decrease speed in deed.&lt;BR /&gt;
&lt;BR /&gt;
My masters in large objects are not tiny too, but I try to keep them clean of stuff, which is not necessary to be there.</description>
      <pubDate>Wed, 15 Jun 2005 07:44:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102825#M37186</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-15T07:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102826#M37187</link>
      <description>Just in case, there is some additional info about "Script type specific issues"&lt;BR /&gt;
&lt;A href="http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/LibDevGuide/TechnicalStandards.html#title4scripts" target="_blank"&gt;here&lt;/A&gt;</description>
      <pubDate>Thu, 16 Jun 2005 12:21:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102826#M37187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-16T12:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102827#M37188</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;In case the PARAMETERS-command is ignored, because the interpreter is in the "wrong" circumstance, the parameter will not be changed either.&lt;BR /&gt;
I prefer:&lt;BR /&gt;
&lt;BR /&gt;
val1="new value"&lt;BR /&gt;
PARAMETERS val1=val1
&lt;/BLOCKQUOTE&gt;

I do this too, and I've observed many cases where it was needed (a problem went away), but I've never understood it. I understand that the parameters script is only executed in limited circumstances, but is it also true that PARAMETERS commands in the Master Script are ignored when in non-parameter-script circumstances?&lt;BR /&gt;
&lt;BR /&gt;
That is, if the parameter script is not run, ignore all PARAMETERS statements in the MS?&lt;BR /&gt;
&lt;BR /&gt;
I think this is weird, but it would explain why the assignment+PARAMETERS construction works.</description>
      <pubDate>Thu, 16 Jun 2005 20:05:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102827#M37188</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2005-06-16T20:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102828#M37189</link>
      <description>When I decided to make it in this 'double' way, I mentioned, that the parameters do not change their value after a PARAMETERS val="change" statement. It is a longer time ago and it was difficult to proof the below following theory, because PRINT and TEXT2 do not work in all running circumstances. I tried to reproduce in AC9, but did not get it again, so maybe the behaviour has now changed.&lt;BR /&gt;
&lt;BR /&gt;
Each object has, stored in its GSM-file, the standard values of a parameter. In the project database (=plan) for each parameter of each instance of the placed object the value is stored again. In earlier times we could see this very fine by doing a PLAN DUMP (missing in AC8.x+). This values can only changed, when you are in settings dialog or you are graphical editing the parameters. (In last case of course not by the PARAMETERS statement)&lt;BR /&gt;
&lt;BR /&gt;
So far so good. Now my theory:&lt;BR /&gt;
&lt;BR /&gt;
When running the script (before starting the MS) for all parameters will be created variables: Same name and same value as stored in the project database. And here comes the point: All changes to your "parameter" as A=A/2 will affect to the variable. But with the PARAMETERS statement you change the value of the storage of parameter in the project database and THIS does not affect to the variable. After finishing this (first) run of the script the next run will start with the new value, set by the parameters-statement, but the rest of the first script will end with the old value. Depending of the necessarity of having the new value this can cause problems.&lt;BR /&gt;
&lt;BR /&gt;
Can you follow this? I differ between parameters (globals and this one out of the parameter-list) and variables (created at runtime).&lt;BR /&gt;
&lt;BR /&gt;
So I make it twice: Change the variable AND the parameter.</description>
      <pubDate>Fri, 17 Jun 2005 11:44:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102828#M37189</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-17T11:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102829#M37190</link>
      <description>If you haven't seen it yet, I posted a wish for Graphisoft to publish script evaluation information so we don't have to theorize about how the interpreter works.  You can find it here &lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=7153" target="_blank"&gt;&lt;/A&gt;&lt;S&gt;&lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=7153" target="_blank"&gt;&lt;/A&gt;&lt;A href="&amp;lt;/s&amp;gt;&amp;lt;LINK_TEXT text=&amp;quot;http://archicad-talk.graphisoft.com/vie ... php?t=7153&amp;quot;&amp;gt;http://archicad-talk.graphisoft.com/viewtopic.php?t=7153&amp;lt;/LINK_TEXT&amp;gt;&amp;lt;e&amp;gt;"&gt;&lt;/A&gt;&lt;/S&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... php?t=7153"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?t=7153&lt;/LINK_TEXT&gt;&lt;E&gt;&lt;/E&gt;.</description>
      <pubDate>Fri, 17 Jun 2005 14:51:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102829#M37190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-17T14:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: LOCK Not Locking!</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102830#M37191</link>
      <description>&lt;BLOCKQUOTE&gt;Jay wrote:&lt;BR /&gt;I have several LOCK functions in my Master Script that are meant to lock parameters depending on other values.  I have at least 3 of them that won't lock the parameter.  I've checked it from every angle -- spelling, punctuation, syntax, order of evaluation, extraneous code, etc. -- and nothing has solved the problem, they just will not lock.  I've spent at least 3 hours trying to solve this problem.&lt;BR /&gt;
&lt;BR /&gt;
The following code is used in a dozen places, only using different parameter names each time.&lt;BR /&gt;
&lt;BR /&gt;
IF DCA_Deadbolt = `-` THEN&lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `-`&lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty`&lt;BR /&gt;
ELSE&lt;BR /&gt;
IF DCA_Deadbolt_Qty = `-` THEN&lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `1`&lt;BR /&gt;
IF TypeChar &amp;lt;&amp;gt; `D` THEN&lt;BR /&gt;
&lt;FONT color="darkred"&gt;PARAMETERS TempVal = "HELLO"&lt;/FONT&gt;  &lt;FONT color="red"&gt;! This line works &lt;/FONT&gt;&lt;BR /&gt;
&lt;FONT color="darkred"&gt;LOCK `DCA_Deadbolt_Qty` &lt;/FONT&gt;&lt;FONT color="red"&gt;! This line DOESN'T &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_evil.gif" style="display : inline;" /&gt; &lt;/FONT&gt;&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
The test line with TempVal works, which tells me the IF function preceeding it is working correctly.  There is absolutely no reason the LOCK function shouldn't work.  Is this a bug, or am I missing something?  I realize it's Friday afternoon, but I can't be THAT delirious.&lt;/BLOCKQUOTE&gt;

Not quite sure why the LOCK isn't working - must have something to do with the fact you are trying to lock the variable being used in the IF statement and you are changing the value of it from when you started the IF statement (just a guess!).&lt;BR /&gt;
&lt;BR /&gt;
Move it outside and this will work.&lt;BR /&gt;
&lt;BR /&gt;
i.e.&lt;BR /&gt;
&lt;BR /&gt;
IF DCA_Deadbolt = `-` THEN &lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `-` &lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty` &lt;BR /&gt;
ELSE &lt;BR /&gt;
IF DCA_Deadbolt_Qty = `-` THEN &lt;BR /&gt;
PARAMETERS DCA_Deadbolt_Qty = `1`&lt;BR /&gt;
ENDIF &lt;BR /&gt;
ENDIF &lt;BR /&gt;
&lt;BR /&gt;
IF TypeChar &amp;lt;&amp;gt; `D` AND DCA_Deadbolt_Qty = `1` THEN &lt;BR /&gt;
PARAMETERS TempVal = "HELLO" ! This line works &lt;BR /&gt;
LOCK `DCA_Deadbolt_Qty` ! This line DOESN'T  &lt;BR /&gt;
ENDIF &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If you have the GDL object open for editing then you must click on another variable before 'DCA_Deadbolt_Qty' will lock.&lt;BR /&gt;
In the object properties of a placed object it locks as soon as you change it.&lt;BR /&gt;
&lt;BR /&gt;
Barry.&lt;BR /&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cool.gif" style="display : inline;" /&gt;</description>
      <pubDate>Wed, 22 Jun 2005 04:13:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/LOCK-Not-Locking/m-p/102830#M37191</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2005-06-22T04:13:46Z</dc:date>
    </item>
  </channel>
</rss>

