lsp/dcl block image preview

lsp/dcl block image preview

Nathan_Tigner
Advocate Advocate
2,292 Views
9 Replies
Message 1 of 10

lsp/dcl block image preview

Nathan_Tigner
Advocate
Advocate

I wanted to preface this with the fact that I don't know .lsp that well. 

 

I was able to piece together some code which let's me select a type of block, displays a list of blocks of those types and then inserts the selected block into the current drawing upon pressing ok.  What I would like is to have a preview image in the dcl of the selected block from the list, but I can't get it to work. 

 

I erased all the code I tried in the lisp because it broke everything. Any help would be greatly appreciated. I will post the lsp, dcl and one of the dims. I couldn't post a .dim extension, so I changed it to .txt. You can just change it back.

 

Any help would be greatly appreciated. 

Thanks!

0 Likes
2,293 Views
9 Replies
Replies (9)
Message 2 of 10

marko_ribar
Advisor
Advisor

I'd say ADC command... If you are still looking for a lisp, look into previous posts before this one :

http://www.theswamp.org/index.php?topic=56484.msg602995#msg602995 

 

[EDIT : BTW. Newer versions of AutoCAD support very good looking dialog boxed INSERT BLOCK palette...]

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 10

Nathan_Tigner
Advocate
Advocate

Thanks for the reply!

 

I ran into that post at the swamp too, and tried to get it to work for me. I'm guessing I just did it wrong, but I couldn't get it to show anything in the dcl. The lisp and dcl still worked, but I couldn't get it to show a preview.

0 Likes
Message 4 of 10

marko_ribar
Advisor
Advisor

Perhaps your blocks are 3D... That's why I suggested using ADC command...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 5 of 10

Nathan_Tigner
Advocate
Advocate

They are all 2D blocks of just lines and text/attributes. They do all have a rotation parameter and some signs have multiple visibility states if they have a left and right variant.

0 Likes
Message 6 of 10

marko_ribar
Advisor
Advisor

Dynamic blocks are also not supported by the lisp... Like I said, have you tried ADC command?

Another thing comes to mind : ALISP dcl don't support block previews very well, but OpenDCL is... So, if you have time, explore OpenDCL runtime and try to find suitable solution through your custom DCL form you create through OpenDCL studio...

Best person to contact is Mr. Owen Wengerd, main author of OpenDCL runtime addon...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 7 of 10

marko_ribar
Advisor
Advisor

@Nathan_Tigner Have you succeeded in this task... I hope I helped you, not receiving feedback from you... If I helped you in some way, you may click on like button or accept solution, if the problem is resolved...

Regards, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 10

Nathan_Tigner
Advocate
Advocate

Sorry @marko_ribar , I got very busy yesterday. 

 

I am currently looking into openDCL as a solution. I have seen a couple of examples of people successfully doing what I am trying to do. Also looking into using slide images instead of a true block preview. I am not sure the exact route I plan to take yet.

 

ADC does work, but my end users don't seem to want to use it, which is why I decided to create this dcl in the first place.

0 Likes
Message 9 of 10

Nathan_Tigner
Advocate
Advocate

After some more research, I have an idea as what I want to try but no idea how to implement it.

 

Could I not create a slide for each block and then call that slide inside of each .dim that populates the list box? So instead of showing an actual preview of the block in the image tile, I will be showing it's corresponding slide.

 

This seems possible, but I have no clue how to get this working in my current lisp.

0 Likes
Message 10 of 10

Sea-Haven
Mentor
Mentor

I have 2x2 3x3 4x3 dcl etc and they are populated with a list of slide images, you can script the making of slides made like a 100 in one go. 

 

The other way is in a menu autocad handles the dcl for you including mutiple pages, you have a Image section.

 

 

screenshot89.png

 

 

//  DD3x3 dialogue.  Used by the DD3x3 command in DD3x3.lsp.
//  Called from the AutoCAD Release 12 Standard Menu.

dd3x3 : dialog {
  label        = "Please choose item";
  : column {
    : row {
      : image_button {
        key          = "33sq1";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq2";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq3";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
    }
    : row {
      : image_button {
        key          = "33sq4";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq5";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq6";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      }
      : row {
      : image_button {
        key          = "33sq7";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq8";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      : image_button {
        key          = "33sq9";
        width        = 10;
        aspect_ratio = 1.0;
        color        = 0;
        allow_accept = true;
      }
      }
  }
ok_cancel;
}

 

SeaHaven_0-1626331764816.png

 

 

 

0 Likes