Author Topic: Newby Help  (Read 20596 times)

The Dark Princess

  • Member
  • *
  • Posts: 16
Newby Help
« on: March 10, 2009, 08:58:56 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3066
    • Outside The Box
Re: Newby Help
« Reply #1 on: March 10, 2009, 09:30:17 AM »
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!

The Dark Princess

  • Member
  • *
  • Posts: 16
Re: Newby Help
« Reply #2 on: March 10, 2009, 01:45:31 PM »
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

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2070
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Newby Help
« Reply #3 on: March 10, 2009, 01:57:40 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3066
    • Outside The Box
Re: Newby Help
« Reply #4 on: March 10, 2009, 02:01:42 PM »
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.

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2070
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Newby Help
« Reply #5 on: March 10, 2009, 02:36:54 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3066
    • Outside The Box
Re: Newby Help
« Reply #6 on: March 10, 2009, 02:51:23 PM »
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.

The Dark Princess

  • Member
  • *
  • Posts: 16
Re: Newby Help
« Reply #7 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

The Dark Princess

  • Member
  • *
  • Posts: 16
Re: Newby Help
« Reply #8 on: March 10, 2009, 03:45:23 PM »
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

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2070
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Newby Help
« Reply #9 on: March 10, 2009, 03:57:18 PM »
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

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2070
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Newby Help
« Reply #10 on: March 10, 2009, 04:37:20 PM »
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

  • Member
  • *
  • Posts: 16
Re: Newby Help
« Reply #11 on: March 10, 2009, 05:03:33 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3066
    • Outside The Box
Re: Newby Help
« Reply #12 on: March 10, 2009, 05:06:06 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).

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 3066
    • Outside The Box
Re: Newby Help
« Reply #13 on: March 10, 2009, 05:10:47 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.

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.

The Dark Princess

  • Member
  • *
  • Posts: 16
Re: Newby Help
« Reply #14 on: March 10, 2009, 08:29:28 PM »
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