Calling an RPK file from CGA

679
5
06-23-2021 12:29 PM
LoringTupper1
New Contributor

Is it possible to call RPK file from a cga rule file? For instance could a cga file that crates a building from a parcel of land including setbacks call the Formal_Park.rpk rule package to be applied to the setback areas of the parcel?

0 Kudos
5 Replies
BrianWamsley
Occasional Contributor III

In my experience...

CGA rules can call other CGA rules, which is a really great practice once you start building a modular library of CGA codes.   But the RPK file is sort of locked.  You wouldn't be able to call your buildings rule into your RPK parcels rule, because the parcels rule is "locked" by the RPK file format.  The RPK rule is a packaged file system that preserves links to assets and textures that may be used.  Great for sharing but not for building upon.   If you know the creator of the RPK maybe ask if they will share their CGA.   Otherwise, you might be able to use a file zipper like 7-Zip to unpackage an RPK (I very strongly advise making a copy before you attempt) and then extracting the CGA you need.  I don't remember how this is done off the top of my head, but I have done it a few times for learning CGA purposes.  You might have to restore the links in the CGA (localize to your file paths) using this process or even use your own assets.  

0 Kudos
LoringTupper1
New Contributor

Thanks for the quick reply Brian!

I think you may have gotten my question backwards though. What I want to do is call an RPK file from a CGA file. My CGA file creates a setback from the parcel boundary and extrudes a building mass. The leftover setback area polygon is then either filled with a colour or a texture. Instead what I would like to do is apply the Park_Formal.rpk rule package to the setback. So I would first import the RPK file in my CGA rule then apply it to the setback area all from within my CGA rule file. I'm not trying to edit the RPK file but simply import it to a CGA file and then apply it to a polygon.

0 Kudos
BrianWamsley
Occasional Contributor III

I cannot drag and drop an RPK into a CGA to auto-write the import rule as I could any other CGA.  So I would guess it's not possible.  

0 Kudos
BrianWamsley
Occasional Contributor III

Another thought occurred to me, the downloadable Redland Redevelopment tutorial has the greenspace construction rules, which are practically the same as the formal park rule, and they are already in CGA format making them easy to call into your code.

0 Kudos
CherylLau
Esri Regular Contributor

It's not possible to import an rpk directly into a cga rule.  RPKs can be created with or without the cga source code included.  If the rpk has the cga source included, then you can unzip the rpk (like any other zip file) to access the cga files, and the cga files could be imported into other cga files.  If the cga source is not included, then you can't import the rpk into another cga file.

 

As Brian mentioned, some park-like cga rules could be found in some of the downloadable examples such as Redlands Redevelopment or Planning 04 Landscape Design (Help -> Download Tutorials and Examples).

0 Kudos