Author Topic: Attach image to a DCL  (Read 10249 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
Re: Attach image to a DCL
« Reply #15 on: February 18, 2013, 01:18:00 PM »
For opendcl I would start with the tutorial at http://opendcl.com/wordpress/?page_id=10   Opendcl also has a forum at http://www.opendcl.com/forum/    The Runtime/Autolisp section is a good place to get help.

Thank you for the link .  :-)

efernal

  • Bull Frog
  • Posts: 206
Re: Attach image to a DCL
« Reply #16 on: February 18, 2013, 03:07:44 PM »
Code - Auto/Visual Lisp: [Select]
  1. (DEFUN c:teste (/ dx dy dh w@)
  2.   (IF (> (SETQ dh (LOAD_DIALOG "c:\\teste\\dcl\\teste.dcl")) 0)
  3.     (IF (NEW_DIALOG "teste" dh)
  4.       (PROGN (SETQ dx (DIMX_TILE "i")
  5.                    dy (DIMY_TILE "i")
  6.              )
  7.              (START_IMAGE "i")
  8.              (SLIDE_IMAGE 0 0 dx dy "c:\\teste\\sld\\teste.sld")
  9.              (END_IMAGE)
  10.              (ACTION_TILE "accept" "(DONE_DIALOG 1)")
  11.              (ACTION_TILE "cancel" "(DONE_DIALOG 0)")
  12.              (SETQ w@ (START_DIALOG))
  13.              (UNLOAD_DIALOG dh)
  14.              (COND ((= w@ 0) (PRINC "\n-> You pressed Cancel"))
  15.                    ((= w@ 1) (PRINC "\n-> You pressed OK"))
  16.              )
  17.       )
  18.       nil
  19.     )
  20.     (ALERT "Unable to load dcl file")
  21.   )
  22.   (PRINC)
  23. )
  24.  
  25. ;|
  26. ;; dcl file
  27. teste:dialog{label="show slide";width=50;fixed_width=true;
  28. :spacer{height=1;}
  29. :image{key="i";width=40;aspect_ratio=0.75;color=0;alignment=centered;}
  30. :spacer{height=1;}
  31. ok_cancel;
  32. }
  33. |;
  34.  
  35. How to make the slide:
  36. Go to paper space
  37. Commands PS + MV
  38. Draw an viewport 1000x750
  39. Zoom extents
  40. Command MS + Zoom extents
  41. Command Mslide, name c:\teste\sld\teste.sld
  42.  
  43. be sure to create the folders before...
  44.  
  45. try the routine...
  46.  
e.fernal

Coder

  • Swamp Rat
  • Posts: 827
Re: Attach image to a DCL
« Reply #17 on: February 18, 2013, 11:12:56 PM »
Thank you efernal ,

Good example , I like it .  :-)

Coder

  • Swamp Rat
  • Posts: 827
Re: Attach image to a DCL
« Reply #18 on: February 19, 2013, 06:57:28 AM »
Check these out
http://www.theswamp.org/index.php?topic=4723.0
http://www.theswamp.org/index.php?topic=3263

CAB , I made a slide of my needed symbol but it does not fit the image , I mean there would be a big black space , sometimes from the top
of the slide and sometimes on other sides .

Can you tell me about the best way of taking a slide to be used in DCL file ?

Attached one slide , if you don't mind to take a look please .

Thank you so much  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attach image to a DCL
« Reply #19 on: February 19, 2013, 09:48:50 AM »
Size the ACAD window to fit the object you want to make a slide from.
Then use the Make Slide command.

See the VLIDE Help for slide_image function code needed to display your slide.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Attach image to a DCL
« Reply #20 on: February 19, 2013, 09:49:38 AM »
Size the ACAD window to fit the object you want to make a slide from. Then use the Make Slide command.

Hint: Use a Viewport  :wink:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attach image to a DCL
« Reply #21 on: February 19, 2013, 09:56:38 AM »
Good tip Lee.

See attached revised slide.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

efernal

  • Bull Frog
  • Posts: 206
Re: Attach image to a DCL
« Reply #22 on: February 19, 2013, 10:28:27 AM »
you must make your slides at paper space, in a viewport with the same proportions as the image component...
e.fernal

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attach image to a DCL
« Reply #23 on: February 19, 2013, 10:38:08 AM »
With my ACAD setup a Viewport slide has a white background and a Model Space slide has a black background.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Coder

  • Swamp Rat
  • Posts: 827
Re: Attach image to a DCL
« Reply #24 on: February 20, 2013, 12:19:34 AM »
Good tip Lee.

See attached revised slide.


Thank you so much for your hard work , I appreciate that so much .
The result is almost the same , and maybe because the shape of the image is rectangle and not a square shape that makes the image looks
narrow to one side in the image space preview .

Thanks.

Size the ACAD window to fit the object you want to make a slide from. Then use the Make Slide command.

Hint: Use a Viewport  :wink:

Thank you Lee .  :-)

I zoomed to extent in a single viewport and then made the slide image , and the result is better than before . thanks a lot .

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attach image to a DCL
« Reply #25 on: February 20, 2013, 08:46:33 AM »
If you care to post some test code we could see what the problem is.
If you are trying to force a rectangular peg in a square hole it will never fit correctly.  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

efernal

  • Bull Frog
  • Posts: 206
Re: Attach image to a DCL
« Reply #26 on: February 20, 2013, 11:48:52 AM »
make your slides in a viewport with same proportions of dimx_tile and dimy_tile
e.fernal

Coder

  • Swamp Rat
  • Posts: 827
Re: Attach image to a DCL
« Reply #27 on: February 20, 2013, 11:51:45 PM »
If you care to post some test code we could see what the problem is.
If you are trying to force a rectangular peg in a square hole it will never fit correctly.  8-)

Thank you CAB , I am using the same code that posted by efernal .

make your slides in a viewport with same proportions of dimx_tile and dimy_tile


Thank you efernal , now I know how to get the slide from viewports . 
It works now as needed , many thanks .  :-D


d2010

  • Bull Frog
  • Posts: 326
Re: Attach image to a DCL
« Reply #28 on: February 21, 2013, 09:02:51 PM »
Hello everyone .  :-)

Is there any example shows how to attach an image to a DCL file and how to attach them please ?

I saw a few examples but I still confused about how to include the image , size and the image extension .

Thank you all

Step1)You install the kitt  full&free from:
http://lisp2arx.3xforum.ro/
Step2)Your Pc must be connected online with your browser
Step3)You run "vlaxcompiler.exe" from "C:\VLAXCOMPIL\BIN\"
Step4)click on the menu(you see the picture clichere.jpg -attached here)
Step5)
        convert SLD to Lisp_Grdraw....
        convert SLD to Lisp_DCL..
        BMP show in DCL image (only for vlisp)
www.youtube.com/watch?v=91_DFjN6ucs
step6)Load the application  pozemari.fas
step7)you enter the command Q2[enter]
step8(Load the application sudokudorin.vlx
step9)You enter the command Q2[enter]
Best Regards..
« Last Edit: November 25, 2017, 02:03:03 AM by d2010 »

Pepe

  • Newt
  • Posts: 87
Re: Attach image to a DCL
« Reply #29 on: February 22, 2013, 04:22:15 PM »
Here is an free, self standing, application to transalte Bitmaps into Lisp funtions for using in DCLs. I think it works up to 2010 version, but i'm not quite sure. I'm very sorry, but it is in Spanish. If you need any help, post it and i'll do translations my best.

The app runs Autocad itself, but i think it is better to run it before running the app.

I post an example about its use. One DCL and a function with the function generated by the app and its main. I've translated author quotes into english...(please, mercy...)

Regards.