6

Using QGIS 3.0, we are working on creating a tool that will allow people to check that their snapping is correct with several linear features stacked on each other. A co-worker of mine figured out how to do it. However, when you first set it up, you have to open the graphical modeler and set the style manually. What she currently has is a path to her own desktop to the folder that has all the possible styles. I am trying to find a way to make it universally, find the CURRENT users profile, THEN search for the file path.

Currently the path is set to something like this:

C:/Users/jwagner/Desktop/Staging Folder/Layer Styles/CableVertex_Incorrect.qml

I tried editing it to use something like this:

Environ("USERPROFILE") & "\Desktop\V1.2\Layer Styles\CableVertex_Incorrect.qml"

We have also tried using "%," and "~" to no avail. The end goal is to have this path already set when we give people the model file. That way we aren't having to personally show every single person on our project how to set styles. I know from personal experience that it will lead to problems later on down the line when trusting everyone else to remember how to properly do it on their own.

0

3 Answers 3

4

I ended up using the "pre-calculated value" field and this format;

@project_home || '/Files' || '/Style-Project-AOI-v2.qml'

Maybe not so pretty, but hard-coded and works if you want to take the project home and subfolders with you on the road.

2

If you use different computer on a network it could be easier to copy your QML on a shared location that all user can access. this way you could hard code the path and if you have to made change to your QML you dont have to update all the copy on every computer.

If that not an option I guess you could copy the QML in a location accessible for all user like C:/CableVertex_Incorrect.qml ...

1
  • 1
    I didn't even think about just dropping the folder on the C: drive. Worked great! Thank you. I would have done the shared drive version, but we log into a VPN that makes the shared drive inaccessible. Having to log out to run the QGIS checker would be counterproductive. Thanks a ton for the quick response! Commented Apr 3, 2018 at 17:01
-3

@model_folder in recent qgis version

1
  • 2
    Welcome to GIS SE. As a new user, please take the Tour. We're looking for longer, descriptive Answers. This is far too short, but could be corrected by adding a reference to documentation and specifying the exact release at which the feature was added. A screen shot of the feature in use would be nice as well.
    – Vince
    Commented May 23 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.