Skip to main content
Question

using @UUID() as a published parameter


Forum|alt.badge.img

Hello all,

I am trying to add one UUID for each CAD file entering the workbench. Is there a way to set a parameter so when a new filename enters the workbench, each feature with the same filename receives the same UUID character? I have tried using a the filenameextractor followed by the attributecreator and using the @uuid() function as the new attribute value. But that just gives each feature a different UUID instead of the same. Any assistance would be appreciated.

Thanks,

David

2 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 2, 2018

Hi @david_prosack88, you can use the Creator (Number to Create: 1) and the UUIDGenerator to create a single feature containing a UUID as an attribute, then merge it to every feature unconditionally with a FeatureMerger. If you make the Creator to run at first, you can set Yes to the Supplier First parameter in the FeatureMerger to run it with better performance.

Instead of the FeatureMerger, you can also use the VariableSetter to store the UUID as a global variable after the UUIDGenerator, and get the value with the VariableRetriever on the main workflow. In this case, the Creator should be run at very first.

Alternatively, you can create a private parameter of Scripted (Python) type to make a single UUID.

import uuid
return uuid.uuid4()
See also here to learn more about the Python uuid module.

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • August 3, 2018

Create one UUID for each unique filename then merge this back to all features


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings