×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Precisely render overlapping geometry

Precisely render overlapping geometry

Precisely render overlapping geometry

(OP)
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
www.nov.com

RE: Precisely render overlapping geometry


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
 

RE: Precisely render overlapping geometry

(OP)
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

RE: Precisely render overlapping geometry

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
 

RE: Precisely render overlapping geometry

(OP)

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 smile .

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

Thanks for your responce.

Tobin Sparks
www.nov.com

RE: Precisely render overlapping geometry

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.

RE: Precisely render overlapping geometry

Oops, nevermind.  It would help if I read the whole question.

RE: Precisely render overlapping geometry

(OP)
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
www.nov.com

RE: Precisely render overlapping geometry

It looks like the "Copy Document Options" macro at: http://swtools.cad.de/download.htm 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
 

RE: Precisely render overlapping geometry

(OP)
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
www.nov.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources