Check proper "Mark" naming convention is being input

Epic stuff John.

Just thinking out loud - but if you put another input (Using the one you created as default for that node), could you in theory allow for that to cover any ‘Mark Naming Convention’?

ie. Flatten({true,true,true,true,false,false,true,true,false,false}); becomes the default and you can write anything.

Potentially for a simple mark of: A01 ({true,false,false}); you can use the custom input?

 

I like your thinking Sol! I will update it now to take a input to match!

:slight_smile:

 

I am posting this on the package manager right now. Great ideas Sol! These thoughts and ideas are what makes this community so great. If I would of thought of the variable option I would have just bundled this into Rhythm :oops: Oh well, the new package is for stuff that’s “by request”. :smiley:

2015-09-16_07h52_52

No reason why you can’t as I didn’t technically ‘request’ that update, merely suggested :smiley:

On another side note… if you could somehow create a new 3D View, and isolate all elements that don’t match the mark format (with their colour) it would be beyond awesome.

I wonder if there is a way to ‘re-run’ it so that the colour override is wiped when they match the format (Say if you’re looking for ‘A100’ and you change ‘AB100-10’ to ‘A100’) as currently the override stays… then again maybe I’m just making more work for the sake of it :smiley:

I thought about the clear overrides as well. I think that will require some python unfortunately :cry:

The isolate thing could be cool too!

 

@Vikram_Subbaiah

I hate to resurrect an old post like this but do you know if the coding you wrote above (along with the MarkFormat1.dyn) is out of date now?

I tried replicating it for my own use and it doesnt seem to work. I also tried downloading the dyn and testing it and it does not work (even after placing DSCore. in front of String.ToNumber.

It simply throws back false for everything.

Hey,

Sorry to butt in… Just check that you know that Design Script Syntax has been updated to replace {} with amongst other things…

http://dynamobim.org/to-dynamo-2-0-and-beyond/#what

Also on a slight digression which might help if you’re not able to get design script working… This AU course discusses a Python method which seems relevant…

Have a quick look at page 20 onwards

Hope that helps,

Mark

1 Like

@rdeardorff Seems like getting item at string index needs to be different in the current version (2.1)
See if this works…
MarkFormat-20180923.dyn (12.4 KB)

//Returns true only for Upper Case Letter
def chkLet(s:string)
{
return=DSCore.Object.IsNull(String.ToNumber(s))?
(String.ToUpper(s)==s?true:false):false;
};

//Returns true only if format is AAA-11-A11
def markFormat(s:string){
return=(String.Length(s)!=10)?false:
(((String.Substring(s,3,1)!="-")||
(String.Substring(s,6,1)!="-"))?false:
((chkLet(String.Substring(s,0,1))!=true||
chkLet(String.Substring(s,1,1))!=true||
chkLet(String.Substring(s,2,1))!=true||
chkLet(String.Substring(s,7,1))!=true)?false:
((chkLet(String.Substring(s,4,1))||
chkLet(String.Substring(s,5,1))||
chkLet(String.Substring(s,8,1))||
chkLet(String.Substring(s,9,1)))?false:true)));
};
1 Like