Jump to content

Learning to work with DCL - image / chose


CafeJr

Recommended Posts

Hi to all,

 

I need a basic instructions to try to learn with DCL files!...

 

1 - How I can show a preview of a image in a chosen item in one toggle button, I have 3 toggles to select, when one of them is chosen it will show a preview of the image (the image is a block inside of dwg file);

 

2 - Chose, how I can start a Dialog with one item selected (the variable [value = "1"], only fill a image as selected item, but don't select it.

 

Thanks in advance to any help.

Link to comment
Share on other sites

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • CafeJr

    22

  • Tharwat

    14

  • Lee Mac

    1

  • harleyfr3ak

    1

Top Posters In This Topic

Posted Images

Something like THIS ?

 

Yes, Tharwat, thanks!... It helps!!!...

 

I'm trying to apply it on my lisp code, the problem to me it's that I have only one img field and 18 items to be chosen in a toggle button... Do you know!... It's a big challenge to a beginner!!!... Ha ha ha... :oops:

 

And about the item 2?... How to validate the first item when the code is started? Do you know it?

Edited by CafeJr
Link to comment
Share on other sites

And about the item 2?... How to validate the first item when the code is started? Do you know it?

 

Your question seems as a challenge although it is not. :)

 

Read about the function set_tile function.

Link to comment
Share on other sites

Your question seems as a challenge although it is not. :)

 

Read about the function set_tile function.

 

Isn't a challenge to anyone that knows what he need to do!... He he he... (I don't know!... He he he...)

 

I tried it after a action_tile, but nothing!...

 

(action_tile
   "rb1"
   "(setq tipo \"C\")(mode_tile \"tog1\" 1)(mode_tile \"tog2\" 1)(set_tile \"img\" \"C:\\Lisp\\Desenvolvimento\\Slides\\slide-C.sld\")"
 )

Link to comment
Share on other sites

Add this function to your program at the top anywhere and just before the line that you use the this function .

 

(defun ShowImage (key sldName )
   (start_image key)
   (fill_image 0 0 (dimx_tile key) (dimy_tile key) 0)
   (slide_image 0 0 (dimx_tile key) (dimy_tile key) sldName)
   (end_image)
 )

 

Then call it like this .

 

(ShowImage \"img\" \"C:\\Lisp\\Desenvolvimento\\Slides\\slide-C.sld\")

Link to comment
Share on other sites

(defun ShowImage (key sldName )
   (start_image key)
   (fill_image 0 0 (dimx_tile key) (dimy_tile key) 0)
   (slide_image 0 0 (dimx_tile key) (dimy_tile key) sldName)
   (end_image)
 )

 

Tharwat, thanks again, it works in part... the initial image that code shows was erased when the action_tile is executed... only it happens...

DCL

:image {width=20;aspect_ratio=0.8;color=0;fixed_height=true;key = img;}

 

 

LISP

[color="blue"](start_image "img") 
 (slide_image 1 1 100 60  "C:\\Lisp\\Desenvolvimento\\Slides\\slide-C.sld")
 (end_image)[/color]

 

It show exactly that I need... to combine your code is not necessary to change "key" to "img"? I tried but still not working!...

Edited by CafeJr
Link to comment
Share on other sites

This example may help you towards your goal (requires Swamp membership to view).

 

Thanks Lee Mac!... It's a very nice code!!!... I'll try to learn something there!!!...

Link to comment
Share on other sites

I don't know what you have in your program and how you managed your codes , so I can say nothing other than the standard behavior of codes that I posted earlier .

Link to comment
Share on other sites

I don't know what you have in your program and how you managed your codes , so I can say nothing other than the standard behavior of codes that I posted earlier .

 

Don't worry and I'm grateful for your help!... I'll try more one shots!... He he he...

Link to comment
Share on other sites

Tharwat,

 

Please, I don't know if I'm correctly...

 

I use mslide to create a Slide file (.sld), but I have no dimensions of that picture, It could be my mistake at my code!... Your code get these dimensions, correct? To see the picture I use vslide, but it only show the pictures, not the picture features.

 

On my DCL file I wrote Width = 20; to show the first image I use width = 100; height = 60.

 

How I can get the slide picture dimensions?...

Edited by CafeJr
Link to comment
Share on other sites

Hi,

 

If you have more than one slide image to use in your program , it is recommended to use the same scale of the model space when taking theses slides and this would help you to have the same image attribute's codes and avoid the different scales of slides .

 

For me I am almost not using slides anymore but anyway try to make a viewport with static scale then activate that viewport by double click in it to open then take your desired slide and this would help you to have the same scale for your slides. :)

 

I don't think that the slide picture dimensions is accessible so if you implement what I have described earlier , you would be in no need of that and what's more you would have a static view size for all your slides .

 

Good luck.

Link to comment
Share on other sites

Hi,

 

If you have more than one slide image to use in your program , it is recommended to use the same scale of the model space...

For me I am almost not using slides anymore but anyway try to make a viewport with static scale...

I don't think that the slide picture dimensions is accessible so if you implement what I have described earlier...

 

Good luck.

 

More one time... thanks Tharwat!...

 

Only to try to show you what I'm doing!... The picture below have only one image view... and I wanna put all of toggle buttons (with different images) in that view...

 

Deti - 1.png

 

All the pictures (slides) are in the same format. I don't know why the view is not working!... The first image is ok, but when the toggle button is activate the screen turns black...

 

AutoDesk - Image Tile-Handling Functions Reference

 

(slide_image 1 1 100 60  "C:\\Lisp\\Desenvolvimento\\Slides\\slide-C.sld")

This code fill the first image... the itens 100 and 60 adjust the size view... is that the only one difference that I can see in your code... :oops:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...