Newby Help

Started by The Dark Princess, March 10, 2009, 08:58:56 AM

Previous topic - Next topic

The Dark Princess

I'm looking to create a resizeable image in a modeless box - is this possible?

here's the code:

(defun c:test (/)
(setq imge (strcat ARCTDRVEPREF "Slides\\DDOOR_HELP.gif") msg "DD Help")
(vl-cmdf "_opendcl")
(dcl_project_load (strcat ARCTDRVESP "\\DSAISoft_Image_Zoom.odcl"))
(if (not (dcl_form_isactive DSAISoft_Image_Zoom))
          (dcl_form_show DSAISoft_Image_Zoom)
)
(dcl_PictureBox_LoadPictureFile DSAISoft_Image_Zoom_Image1 imge T)
(dcl_Control_SetCaption DSAISoft_Image_Zoom_Title msg)
(defun  c:DSAISoft_Zoom_Image_OnClicked (/)
  (dcl_Form_Close DSAISoft_Image_Zoom)
)
(defun c:DSAISoft_Close_OnClicked (/)
  (dcl_Form_Close DSAISoft_Image_Zoom)
)
)

This thing works, and I can resize the box, but the image doesn't resize with the box.  Any Ideas?

do I need to set up a resize event and clear and reset the image? 

TDP

owenwengerd

OpenDCL will handle the resizing of the image automatically; you just have to tell it how you want the image to be resized as the dialog is resized. Open your .odcl file, select the picture box control, click on the (Wizard) property in the property pane (or right click on the control and select 'Properties'). In the Geometry tab, change the Right Side Alignment and Bottom Side Alignment to "Offset From Right Edge" and "Offset From Bottom Edge" respectively. Voila!
Owen Wengerd (Outside The Box) / ManuSoft

The Dark Princess

Thanks Owen,  Eevrything is great although I've had to play a lot with the image files to get them to look okay.  Any help in that area would be appreciated.

Lastly, a quick question regarding deplyment.  In the past you shipped out the .arx files and used a little lisp to make sure the right one is loaded.  I guess I could have the runtime installed using network deplyment - or is there a simpler way?

Thanks

TDP

Fred Tomke

Hi,

using the msi or msm (to merge with your installation) is the easiest way: just call the command "_OPENDCL". Advantages: you don't cars about processor architecture, AutoCAD release and so on - OpenDCL does everything for you. Just call this command and OpenDCL will be loaded. Have a look at the samples for further details.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

I'm no image file expert, but I'm curious what issues you encountered.

Installing the runtime MSI (or MSM) via network deployment or otherwise is the only safe way; otherwise there's a risk of conflict with another OpenDCL application. See also http://www.opendcl.com/HelpFiles/ENU/Advanced/Deployment.htm.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

I don't know if you mean AutoCAD as network image or your application as network image.

There is a point in the AutoCAD network image creation where you can add AutoCAD service packs as msm files. Try to add them but do not select merging it. As far as I know (please improve me) merging does extract all the files instead of calling the setup script inside the msi. Calling the script is necessary to create the reg key for AutoCAD.

I'll give a try to install that way!

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Simply merging the MSM would be all that is needed, as long as the custom actions that create the demand-loading keys run after the AutoCAD registry keys are created. Merging the runtime MSM with an AutoCAD deployment should work in theory; it would be interesting to test it.
Owen Wengerd (Outside The Box) / ManuSoft

The Dark Princess

so here's a dumb query.  my start up functions access network folders for data (updates etc).
is there not a simple test, that works for xp and vista, win 32 and 64, that if the opendcl folder isn't found or some such simply launches the .msi from the network folder?

a la

(startapp opendclmsipath  (strcat "\"" OpenDCL.Runtime.5.0.2.2.msi "\""))

TDP

The Dark Princess

I looked at the msm thing, but we have so many variations that it would be a nightmare.

revit 2008 + autocad 2008 32 +64
revit 2008 + autocad architecture 2008 32 + 64
revit 2009 + autocad 2009 32 + 64
revit 2009 + autocad architecture 2009 32 + 64
on win xp, 32 + 64, and win vista 32+64.

I think I'll go the other route.

Thanks for the great replies.

TDP

Fred Tomke

Just because you have so many variations, you should use the msi or msm. How do you install your application?
You can have a test whether OpenDCL is installed or not if you try to find the HKLM\Software\OpenDCL key.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Fred Tomke

Ok, it doesn't seems to be very easy to include OpenDCL Runtime installation into network image. AutoCAD requires an MSP file (I had an MSM file in mind) for servicepacks, which can be extracted from the servicepack.msi but obviously not from the OpenDCL Runtime MSI. Finally there's no point to call an msi afterwards but tomorrow I will check if there's an other option.

I also tried to select the MSM anyway (using the All Files filter) but AutoCAD critized it that this file would match to the AutoCAD installation  >:( .

@ TDP: Do you deploy software via Novell Zenworks? Then it should be possible to configure the package to install the OpenDCL-msi after AutoCAD-msi.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

The Dark Princess

they run an install to make sure my system is loaded....I will simply check for that hklm key to determine if opendcl is installed otherwise my app will launch the installer.

I think this will be fine - if they are doing new installs the .msi will be added after my stuff is loaded. if it's existing my app will catch it.

I assume the _opendcl just needs to be run once at startup?

TDP

owenwengerd

Quote from: The Dark Princess on March 10, 2009, 03:42:13 PM
so here's a dumb query.  my start up functions access network folders for data (updates etc).
is there not a simple test, that works for xp and vista, win 32 and 64, that if the opendcl folder isn't found or some such simply launches the .msi from the network folder?

a la

(startapp opendclmsipath  (strcat "\"" OpenDCL.Runtime.5.0.2.2.msi "\""))

TDP

You can use (startapp "msiexec /i W:\\OpenDCL\\OpenDCL.Runtime.5.0.2.2.msi") (or add /q to do it without any UI). Depending on your OS and settings, you may need to copy the file to a local drive first. Note that you can use (dcl_UpdateCheck) to check whether a newer version is available online (but there is not yet a fixed URL that automatically redirects to the latest version).
Owen Wengerd (Outside The Box) / ManuSoft

owenwengerd

Quote from: The Dark Princess on March 10, 2009, 05:03:33 PM
I think this will be fine - if they are doing new installs the .msi will be added after my stuff is loaded. if it's existing my app will catch it.

Does your app have an uninstaller? I recommend to always install the runtime MSI when your app is installed and always uninstall (with msiexec /u) when your app is uninstalled. That way, the runtime files get correctly reference counted, and removed when the last app that needed them is removed.

Quote from: The Dark Princess on March 10, 2009, 05:03:33 PM
I assume the _opendcl just needs to be run once at startup?

Yes, but there is no overhead in running it multiple times, so I recommend to always run it at the beginning of any command or function that needs it just in case it got manually unloaded in the meantime.
Owen Wengerd (Outside The Box) / ManuSoft

The Dark Princess

Thanks for all the great help.  I've got the network thing done and it works like a charm.  Here's the final weird thing.  I moved away from modeless to try a modal form.  The lsp below will not show the ociture when it runs the first time in a drawing, but shows the picture every time it's called after that.  What should I do to the lisp to get it working?

(defun DSAI_Img_Zoom ( imge iwid ihgt  / )
(dcl_project_load (strcat ARCTDRVESP "\\DSAISoft_Image_Zoom.odcl"))
(dcl_Form_Show DSAISoft_Image_Zoom)
  (dcl_Control_SetWidth DSAISoft_Image_Zoom iwid)
  (dcl_Control_SetHeight DSAISoft_Image_Zoom ihgt)
(defun c:DSAISoft_Image_Zoom_OnInitialize (/)
(dcl_PictureBox_LoadPictureFile DSAISoft_Image_Zoom_Image1 imge T)
)
(defun  c:DSAISoft_Image_Zoom_Image1_OnClicked (/)
  (dcl_Form_Close DSAISoft_Image_Zoom)
)
)

thanks

TDP