Profile name in Master Script

Home Forums Problems and solutions in GDL Parameter connections Profile name in Master Script

This topic contains 2 replies, has 2 voices, and was last updated by  Bruce Walker 2 months ago.

  • Author
    Posts
  • #18196

    Bruce Walker
    Participant

    I have an object that uses complex profiles to generate its geometry. I need to be able to extract the name of the profile to run a SPLIT command to automatically fill in other parameters.

    E.g. Profile names: Sleeve Type S01; Sleeve Type S02.

    I would SPLIT the profile name “Sleeve Type S01” to extract the number (i.e. 1) and then run further tests, fill parameters, and run schedules.

    E.g.

    n = REQUEST ("Name_of_Profile", myProfileIdx, pName)
    IF n THEN p = SPLIT (pName, "%s", txt1)
    
    IF txt1 = "Sleeve" THEN ! Correct profile chosen
    	n1 = SPLIT (pName, "%s %s %s %n", txt1, txt2, txt3, num1)
    ELSE
    	num1 = 0
    ENDIF
    
    IF n1 THEN
    	IF num1 >1 THEN
    		cond = "Strengthened"
    	ELSE
    		cond = "Carbon Wrap"
    	ENDIF
    ENDIF
    
    PARAMETERS cond = cond

    The only problem with this, is that I can’t use the REQUEST (“Name_of_Profile” in either the Master or Parameter scripts (it’s a project dependent request), and the other scripts can’t write parameter values. I’m stuck. Anyone got a solution?

    www.brucepwalker.com
    https://www.mindmeister.com/65450406

    AC20 6005 AUS Full & AC 21 3009 NZE Full | Win 10 Pro 64 | Intel i7-7700HQ 2.80GHz | 16 Gb RAM
    NVIDIA GeForce GTX 1060 8Mb

  • #18197

    Gergely Fehér
    Keymaster

    Hi Bruce,
    You can not and should not reach any data of a profile from parameter script (including master, when it runs before parameter script). If you would be able to do so, that could cause inconsistent data in a plan file, as you can place an object using profiles, after that if you change anything in the profile that won’t be followed by a parameter script run, so your object could easily store outdated information or invalid, inconsistent data.

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

  • #18198

    Bruce Walker
    Participant

    Thanks Gergely – I had suspected that was the reason. I take it from your answer that there really is no way for me to achieve what I need. No matter.

    It makes me try to think of a use for the REQUEST (“Name_of_Profile”… what use would it be in the 2D / 3D script?

    www.brucepwalker.com
    https://www.mindmeister.com/65450406

    AC20 6005 AUS Full & AC 21 3009 NZE Full | Win 10 Pro 64 | Intel i7-7700HQ 2.80GHz | 16 Gb RAM
    NVIDIA GeForce GTX 1060 8Mb

You must be logged in to reply to this topic.