CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > Annotation

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 08-16-2007, 01:26 PM
herbcline herbcline is offline
Registered User
 
Join Date: May 2007
Posts: 9
Multipe am_customize files?

I have One Space Modeling 2007 on a laptop. While on the road I don't want to get our custom borders, which on on a network drive. While in the office I want them

Has anyone come across this?

Batch file to rename the file each time?
Reply With Quote
  #2  
Old 08-16-2007, 02:41 PM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
Re: Multipe am_customize files?

Make a system variable defining SDSITECUSTOMIZEDIR or SDCORPCUSTOMIZEDIR as your network location. By default, OSD will start and look for the am_customize file in those folders before looking in the installed one on your laptop. Edit the am_customize file in those folders to grab the custom borders, but leave the am_customize file on your laptop alone. That should do it.
Reply With Quote
  #3  
Old 08-17-2007, 04:59 AM
herbcline herbcline is offline
Registered User
 
Join Date: May 2007
Posts: 9
Re: Multipe am_customize files?

I do create those directories in my batchfile:

set SDSITECUSTOMIZEDIR=H:\CoCreate\osd_customize_15
set SDUSERCUSTOMIZEDIR=U:\osd_customize_15

The issue is, and I inherited this setup, that the customize file hard codes the border locations:
;;(defvar *anno_path* "V:/CoCreate/osd_customize_15/Annotation")
Then calls out the borders:
(docu-register-frame :ui-name "B_IN_STD" :file (format nil "~A/CompanyBorders/b_in_std.mi" *anno_path*))

I would like it to use the SDUSERCUSTOMIZEDIR but do not know how to code it.
Reply With Quote
  #4  
Old 08-17-2007, 07:36 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: Multipe am_customize files?

Hi,

I believe that this will do what you want it to do:
Code:
(defvar *anno_path*  (oli:sd-convert-filename-from-platform 
                               (oli:sd-sys-getenv "SDUSERCUSTOMIZEDIR"))) 

(docu-register-frame :ui-name "B_IN_STD" 
                     :file (format nil "~A/CompanyBorders/b_in_std.mi" *anno_path*))
Does this work for you? If you want to use the site or corp customize directories, just change the above SDUSERCUSTOMIZEDIR to whatever you need.

Good luck!

andy
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #5  
Old 08-17-2007, 08:57 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Re: Multipe am_customize files?

When a Lisp loader reads a Lisp file, it initializes the global variable *load-truename* with the path of that file. The type of that variable is a Lisp pathname; more on Lisp pathnames at http://www.lisp.org/HyperSpec/Body/sec_19-2.html .

You could this feature to find files which are located relative to the path of sd_customize or am_customize. For example, you could do the following in am_customize:

Code:
  (setf *my-current-customization-path* 
    (directory-namestring *load-truename*))
*my-current-customization-path* now contains (as a string) the directory from which am_customize was loaded. Why could this help in a set of customization files? Because it helps to reduce the number of hard-coded paths - in most places, you'll use relative paths only, and those don't change even if you move the customization files from a network drive to a local drive.

For more on *load-truename*, see http://www.lisp.org/HyperSpec/Body/var_stload-pa_d-truenamest.html

Hope this helps,

Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/

Last edited by clausb; 08-18-2007 at 03:39 AM.
Reply With Quote
  #6  
Old 08-17-2007, 10:08 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Multipe am_customize files?

Quote:
Originally Posted by herbcline View Post
I do create those directories in my batchfile:

set SDSITECUSTOMIZEDIR=H:\CoCreate\osd_customize_15
set SDUSERCUSTOMIZEDIR=U:\osd_customize_15

The issue is, and I inherited this setup, that the customize file hard codes the border locations:
;;(defvar *anno_path* "V:/CoCreate/osd_customize_15/Annotation")
Then calls out the borders:
(docu-register-frame :ui-name "B_IN_STD" :file (format nil "~A/CompanyBorders/b_in_std.mi" *anno_path*))

I would like it to use the SDUSERCUSTOMIZEDIR but do not know how to code it.
Hmmm. This looks suspiciously like something from HP. If you work for HP you might want to check with your internal support. They may better understand what happens when you are off the network.

It appears that the site and user paths are set to mapped network drives. I'm suprised that doesn't cause error messages when you are off the network, but without more details it is difficult to know how your startup works

If the frames are the only issue, maybe the easiest solution would be to create a LISP file that you can load manually when off the network to register your local frame files. For example:
Code:
 
;; Unregister all current frames to start with an empty list
(docu:docu-unregister-frame-all)
;; Register each frame file one at a time from local drive path
(docu:docu-register-frame :ui-name "My_A_Frame"
  :file "C:/My_Frames/A_Size_Frame.mi")
(docu:docu-register-frame :ui-name "My_B_Frame"
  :file "C:/My_Frames/B_Size_Frame.mi")
You need to change the :ui_name strings to whatever name you wish to see in the user interface and the :file paths to match your file names and locations.

If you copy this code into a LISP file in a convenient path (named something like load_my_frames.lsp), then you can load it from Annotation by using File/Load... and changing the File Type: to LISP Source (*.lsp;*.lisp). You don't have to run anything, just loading the LISP file will register your frames.

If you want to make it easier you could create a custom toolbar button, abbreviation, or keyboard shortcut to run the load command. Something like:

(load "C:/my_path/load_my_frames.lsp")
__________________
John Scheffel
Reply With Quote
  #7  
Old 08-17-2007, 10:47 AM
jwilson jwilson is offline
Registered User
 
Join Date: Apr 2003
Posts: 17
Re: Multipe am_customize files?

I have custom borders which I store on my local hard drive. Just include the paths in a copy of the corporate am_customize file. When you bring up annotation and open the frame type, you should see all the corporate and custom borders listed.
Reply With Quote
  #8  
Old 08-17-2007, 11:26 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Multipe am_customize files?

Quote:
Originally Posted by herbcline View Post
set SDSITECUSTOMIZEDIR=H:\CoCreate\osd_customize_15
set SDUSERCUSTOMIZEDIR=U:\osd_customize_15

;;(defvar *anno_path* "V:/CoCreate/osd_customize_15/Annotation")
Q: when connected to your Intranet: is V:/ neither SITE/CORP customize dir? -> so an additional location?

--------------
why not having V: on your laptop?

Code:
# batch file
subst v: /d >nul:
if exist V:\*.* echo "welcome to the Intranet"

if not exist V:\*.* subst v: c:\copy_of_v_in_intranet

whereever\IntNT\SolidDesigner.exe
This is the concept. In general I would make a copy of intranet v: to the laptop, if connected
Code:
subst v: /d
if exist v:
  echo "we are in company"
  xcopy v:\*.* c:\copy_of_v_in_intranet  /H /R /K /Y /C /I /S /D
else
  echo "we are alone :-\"
  subst v: c:\copy_of_v_in_intranet
fi
for testing the xcopy you can use in addition the /L parameter: does not copy anything, but LISTS what would happen.

Last edited by Wolfgang; 08-17-2007 at 11:44 AM. Reason: one more parameter for xcopy added
Reply With Quote
  #9  
Old 08-22-2007, 12:51 PM
herbcline herbcline is offline
Registered User
 
Join Date: May 2007
Posts: 9
Re: Multipe am_customize files?

A former division of HP
Reply With Quote
  #10  
Old 08-23-2007, 09:07 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Multipe am_customize files?

Quote:
Originally Posted by herbcline View Post
A former division of HP
Yet another former division of HP. I have often wondered if anyone has a list or chart showing all the companies that were once a part of HP before modern CEOs decided that managing a big multi-product company is just too hard.
__________________
John Scheffel
Reply With Quote
  #11  
Old 08-23-2007, 11:32 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Multipe am_customize files?

[OFF TOPIC]

Quote:
Originally Posted by John Scheffel View Post
Yet another former division of HP
raising the hand: CoCreate! Just for those who don't know.
Reply With Quote
Reply


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

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 10:10 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.