CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-14-2008, 01:58 PM
coroto coroto is offline
Registered User
 
Join Date: Sep 2003
Location: Santa Rosa, CA
Posts: 75
Question Save & Restore Annotation settings?

Hello,

We have a few old utilities for annotation which we've found leave the user's annotation settings in "Compatible" mode after being run. This is due to the way they set certain text or geometry settings to use while creating the text and/or geometry they are designed to generate.

With the new Annotation settings scheme on v15.x, what is the clean and recommended way to avoid this issue?

Is there a good and fairly simple way to update this kind of utility so it can save the current settings and then later restore them after doing its job?
Reply With Quote
  #2  
Old 01-14-2008, 11:08 PM
Markus Markus is offline
Registered User
 
Join Date: Oct 2002
Location: Sindelfingen, Germany
Posts: 88
Re: Save & Restore Annotation settings?

Hello coroto,

Quote:
Originally Posted by coroto View Post
Is there a good and fairly simple way to update this kind of utility so it can save the current settings and then later restore them after doing its job?
For text settings the recommended way is to use the on-the-fly settings when creating a text. That way you don't have to modify the default settings.
Unfortunately we don't have on-the-fly settings for geometry (yet). Here the recommended way is to use the Integration Kit functions sd-freeze/unfreeze-setting-value on the geometry settings branch.

Hope this helps.

Markus
Reply With Quote
  #3  
Old 01-15-2008, 04:00 AM
Gary Brauch Gary Brauch is offline
Registered User
 
Join Date: Oct 2002
Location: Colorado
Posts: 220
Re: Save & Restore Annotation settings?

I'd recommend creating a new text style in the table.

If you want the text to be a different size, color or font, just set it up and give it a new name.
I would not change one of the defaults, just create a new one.

Now you can call that text to be used throughout the rest of the default settings where text is used.

Same with the geometry.
Reply With Quote
  #4  
Old 01-15-2008, 02:16 PM
coroto coroto is offline
Registered User
 
Join Date: Sep 2003
Location: Santa Rosa, CA
Posts: 75
Re: Save & Restore Annotation settings?

Thanks for your replies.

Markus, can you please give an example of creating text using this "on-the-fly" technique? I'm not sure I know what you're referring to.

The freeze/unfreeze is really good to know about; I hadn't spotted that in the I-Kit before! However, in this one utility I'm looking at, the issue is this: the old commands AM_TEXT_SETTINGS and AM_GEO_DEFAULT are used ahead of the create commands, and the freezing/unfreezing I've added into the mix doesn't prevent my Settings from ending up in "Compatible" mode. The text is created using sd-am-create-text and the geometry by sd-am-create-geo-straight.

Hmm, looks like I have more digging/rewriting to do!

Aha, if I freeze/unfreeze ALL the settings then it does get me back where I was (i.e. not "Compatible"), but just doing the Annotation/Text and Annotation/Geometry paths lands me in the dreaded "Compatible" state. Interesting...

Last edited by coroto; 01-15-2008 at 02:48 PM.
Reply With Quote
  #5  
Old 01-16-2008, 10:05 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Save & Restore Annotation settings?

well for texts you can directly call the dialog and use the on-the-fly-settings.
so instead of
PHP Code:
;; version 14.00
(setq old-text-settings (sd-am-inq-curr-text-attributes))
(
sd-call-cmds
  
(AM_TEXT_SETTINGS :filled "OFF" :size 5.0 :color 15377182 :done))
(
sd-am-create-text
  
:owner ... 
  :
text "My colorful text with 5mm height"
  
:position 47,11
 
)
(
sd-call-cmds
  
(AM_TEXT_SETTINGS  ... restore old settings...  )) 
just use
PHP Code:
(sd-call-cmds 
 
(AM_CREATE_TEXT
 
:owner :current_sheet
 
:filled "OFF" :size 5.0 :color 15377182 :done
 
:docu-text "My colorful text with 5mm height"  47,11
)) 
The good thing is that you can add any setting without taking care to correctly reset it.

For GEO the on-the-fly-settings are not available. That's a pity. But freeze/unfreeze is also easier than restoring every single setting.
Reply With Quote
  #6  
Old 01-16-2008, 10:17 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Lightbulb Re: Save & Restore Annotation settings?

Quote:
Originally Posted by coroto View Post
Aha, if I freeze/unfreeze ALL the settings then it does get me back where I was (i.e. not "Compatible"), but just doing the Annotation/Text and Annotation/Geometry paths lands me in the dreaded "Compatible" state. Interesting...
NO! sorry for shouting. Then you are doing something wrong.

If you freeze the "Annotation/Text" path you can do want you want below this node
Then you use unfreeze "Annotation/Text" and everything is gone. (hopefully not OSDM )

You can call freeze/unfreeze on command line and play arround in between interactively with the settings browser. This might be easier to watch out what your are doing.

One more tip:
open the console window! If old setting functions are called (which are covered by the settings browser now) an information is printed into the console window. So it might be there's a call to another setting you did not notice yet. The information in the console shows you WHAT old function was called (so you can search your sources) and WHICH new setting is to be used as replacement.

Only when NONE of the old setting functions is used you will get rid of the 'compatible' style... in your piece of code.

HTH
Wolfgang
Reply With Quote
  #7  
Old 01-16-2008, 12:23 PM
coroto coroto is offline
Registered User
 
Join Date: Sep 2003
Location: Santa Rosa, CA
Posts: 75
Re: Save & Restore Annotation settings?

Wolfgang,

Thanks for the example for am_create_text. I was trying to use the integration kit function sd-am-create-text instead, which doesn't provide the on-the-fly properties setting. So, it's easy to get rid of the calls to am_text_settings.

The problem I have is that a single call to am_geo_default (or am_text_settings, for that matter) will cause my Annotation settings to go "Compatible" -- and it affects all of these settings (regardless of what values were or were not set/changed): the Annotation/Text/Appearance, the Annotation/Geometry/Standard Line Style, the Annotation/Geometry/Construction Line Style, and also the Annotation/Hatch/Appearance.

So, I've had to freeze/unfreeze all the settings to make it go back to where things were. I tried doing the freeze/unfreeze on the 3 paths Annotation/Text, Annotation/Geometry and Annotation/Hatch, and even on the whole Annotation path, to no avail. The only sequence which gets everything back to normal is like this:

(oli:sd-freeze-setting-value) (am_geo_default) (oli:sd-unfreeze-setting-value)

Anyways, thanks for your help, and I appreciate it when you point out something I'm doing wrong. It looks like what I really need to do is get rid of all those old obsolete commands, and not try to use the "band-aid" of the freeze/unfreeze-all. If I get rid of the obsolete commands, then the freeze/unfreeze of the particular path for the specific settings I'm tweaking will probably work as it should.

Last edited by coroto; 01-16-2008 at 12:37 PM.
Reply With Quote
  #8  
Old 01-17-2008, 02:39 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Save & Restore Annotation settings?

Quote:
Originally Posted by coroto View Post
Thanks for the example for am_create_text. ......So, it's easy to get rid of the calls to am_text_settings.
Fine!
Quote:
...a single call to am_geo_default ....settings .. go "Compatible"
.....
(oli:sd-freeze-setting-value) (am_geo_default) (oli:sd-unfreeze-setting-value)

get rid of all those old obsolete commands....
Dooooooiinnnnngggggg.. Now we found the misunderstanding. You should not call the old setting functions at all!
PHP Code:
(oli:sd-freeze-setting-value ......)
(
oli:sd-set-setting-values 
        
:APPLICATION "Annotation"
        
:STYLE-PATH "Annotation/General/LineStyle" :STYLE :style_4712
        
:VALUES (list "Ltype" :DASHED "Color" 65280 "Pensize" 0.7 "PenScaled" NIL))
(
oli:sd-set-setting-value "Annotation/Geometry/Standard" :value :style_4712 )

create geo here.. 

(
oli:sd-unfreeze-setting-value ......) 
SD-SET-SETTING-VALUES creates a style (can be used elsewere, or x times reused)
SD-SET-SETTING-VALUE does activate that style for standard geometry as default.

Be aware of singular and plural for the functions names. This makes it sometimes difficult to find the right typo.

next round....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:37 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.