Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Precisely render overlapping geometry

Status
Not open for further replies.

Tobin1

Petroleum
Nov 9, 2007
176
Howdy All,

I posted this question once before - I just want to make sure of the answer. Maybe I'll ask the question different :)

Is it possible to gain access through VB code to every SW system setting? Are there some settings (or commands for that matter) that are just flat-out not available?

The one I'm particularly interested is a new setting to SW 2007 (not sure if it’s still in 2008) and can be accessed manually at TOOLS -> OPTIONS -> DOCUMENT PROPERTIES -> IMAGE QUALITY.
In the frame titled "Wireframe and high quality HLR/HLV resolution", the check box for "Precisely render overlapping geometry (higher quality, but slower)".
This seems to only be availably in a .slddrw type file. We've noticed that this one pick can make a file size 1.5 times bigger but can't tell any difference in the quality.
Maybe because of the kind of work we do.
We would like to be able to access this setting through code to turn it off (un-check) the box.

Can anybody help? I've already tried SW Help -> SolidWorks and Add-Ins API Help topics.

It would be helpful to know if it's NOT even possible to access.

Thanks


Tobin Sparks
 
Replies continue below

Recommended for you


I’m on SolidWorks 2007 SP 2.2 and I do not see the checkbox that you are describing. Maybe it is a feature of a later service pack.

I believe that the typical way to manipulate a document property like this one would be through the ModelDoc2::SetUserPreferenceToggle method. You would need the swUserPreferenceToggle_e value associated with this checkbox. You may be able to find it in the API documentation. There appears to be a separate method and value list associated with properties of different types. Toggle seems like the most likely suspect for a check box, but who knows.

And to answer your other question, it is likely that the API is not complete.

Eric
 
EEnd

Thanks for your responce. Attached is a screen shot of the setting we're trying to access. We are using SW 2007SP5.0.

Yes I have been digging thru SW Help -> SolidWorks and Add-Ins API Help topics -> swUserPreferenceToggle_e but can't seem to find it.

<likely that the API is not complete> gives me a bad feeling.

Thanks

Tobin Sparks
www.nov.com
 
 http://files.engineering.com/getfile.aspx?folder=ecf6ff2f-0de4-47df-8b27-e8a82a699a26&file=Precise_Geometry.bmp
That checkbox is not present in 2.2, so it must have been added with one of the later service packs. It may be that the API supports toggling this, but the documentation has not been updated to reflect that.

The swUserPreferenceToggle_e values are just longs, so you could try to see if one of them is associated with that box. To do this, write a macro which uses ModelDoc2::GetUserPreferenceToggle to query and record the values returned for all the numbers between 1 and say 1000, pauses so that you can toggle the checkbox and re-queries the vales to see if any of them have changed.

If you get a number whose value changed, you can probably use that in the set method to toggle the switch. If you don’t find one that has changed you can try increasing the upper limit on the value. My guess is that a long can be between 0 and 4294967295, so a full sweep would be difficult.

Eric
 
WOW - Okay - that's very interesting.

This sounds like something I really need to learn about. I'm kinda new to this so this is not something I've done or seen done before.

I hate to ask but if you or anyone else reading this could elaborate a litte. More toward the beginner level :) .

FYI - I do know how to record macros and I'm learning VB.net.

Thanks for your responce.

Tobin Sparks
 
Check out ModelDoc2.GetTessellationQuality and ModelDoc2.SetTessellationQuality. These change the document specific image quality settings. I found them in the API help by looking up Image Quality.
 
Thanks takedownca for the information. I appreciate your effort.

I'm very interested in "EEnd"s" post about -
<To do this, write a macro which uses ModelDoc2::GetUserPreferenceToggle to query and record the values returned for all the numbers between 1 and say 1000, pauses so that you can toggle the checkbox and re-queries the vales to see if any of them have changed.>

I'm not familiar with exactly how to do this and would like to learn more.

Thanks

Tobin Sparks
 
It looks like the "Copy Document Options" macro at: does this for the most part. The site is in German, and it is an excel macro, but inside the excel file there are instructions on how to get it to work in English. If the API has control of the parameter, you should be able to find its value by: running the macro, copying column D somewhere safe (column F or higher), changing the setting, running the macro again and seeing what has changed.

Eric
 
Thanks EEnd I'll check it out.
Funny - just last week I was looknig over this site and down loaded a couple other things.

Thanks Again

Tobin Sparks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor