Author Topic: rename block with preview  (Read 20735 times)

0 Members and 1 Guest are viewing this topic.

Sam

  • Bull Frog
  • Posts: 201
rename block with preview
« on: July 31, 2012, 03:36:48 AM »
Dear All,

It's Possible rename block with preview
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #1 on: July 31, 2012, 03:51:26 AM »
I'm assuming you mean you'd like a dialog for renaming blocks - where there's a preview of the block. Unfortunately it's not exactly too easy to do in Lisp & DCL. In this case you need to generate a SLD file from the block, then load that onto the DCL dialog's image tile (for each block selected). This might take a while, since you'll first need to insert each block in turn in a blank space, zoom to object, and call the mslide command to generate the SLD file for that block. Only then can you run the dialog.

An alternative would be to install ODCL (it has a built-in tile which previews blocks).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Sam

  • Bull Frog
  • Posts: 201
Re: rename block with preview
« Reply #2 on: August 01, 2012, 02:06:30 AM »
I'm assuming you mean you'd like a dialog for renaming blocks - where there's a preview of the block. Unfortunately it's not exactly too easy to do in Lisp & DCL. In this case you need to generate a SLD file from the block, then load that onto the DCL dialog's image tile (for each block selected). This might take a while, since you'll first need to insert each block in turn in a blank space, zoom to object, and call the mslide command to generate the SLD file for that block. Only then can you run the dialog.

An alternative would be to install ODCL (it has a built-in tile which previews blocks).
Dear Sir,
thx...
Every time we waste electricity, we put our planet's future in the dark. Let's turn around our attiude and start saving power and our planet, before it's too late
http://www.theswamp.org/donate.html

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #3 on: August 01, 2012, 05:36:36 AM »
Glad to help. Attached is a version  which uses ODCL. Note you'll need to install the ODCL Runtime version 6, either that or the Studio if you want to create your own ODCL dialogs. You don't need both as the Studio includes the runtime already.

Save both files into a folder on your support path & have the LSP file loaded. Then the command is RenBlocks. It should open a modeless dialog (i.e. while it's open you can still do other things in the drawing) with a list of block names and a preview. Below the preview is a field to type the new block name and a rename button.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: rename block with preview
« Reply #4 on: August 01, 2012, 05:57:32 AM »
Thanks irneb for the nice App.

It worked in Cad 2010 but didn't in Cad 2013 .

Quote
Command: RENBLOCks
Unknown command "OPENDCL".  Press F1 for help.
; error: no function definition: DCL_PROJECT_LOAD

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #5 on: August 01, 2012, 06:05:31 AM »
I think you need ODCL version 7 for 2013. I've not tested it, but I think you need not upgrade the ODCL file itself - it should still work on newer versions.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: rename block with preview
« Reply #6 on: August 01, 2012, 06:26:20 AM »
I think you need ODCL version 7 for 2013. I've not tested it, but I think you need not upgrade the ODCL file itself - it should still work on newer versions.

You're right , it works nicely now after downloading the latest version .  :wink:

Thank you .

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #7 on: August 01, 2012, 07:07:42 AM »
Glad it works! Just sorry there needs to be an addon to get a decent UI for acad from lisp  :pissed: . IMO ODCL should form part of base acad, replacing the 20 year old DCL system.

I tried using the Block List instead of a normal listbox, since it shows a preview directly inside the listbox (similar to Design Center). But I couldn't find a way to reset the lisbox after renaming the block - it would still display the old name  :| . Perhaps I've missed something.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

HasanCAD

  • Swamp Rat
  • Posts: 1420
Re: rename block with preview
« Reply #8 on: August 01, 2012, 08:01:34 AM »
Should I instal OpenDCL Or loading *.arx is enough?

kruuger

  • Swamp Rat
  • Posts: 625
Re: rename block with preview
« Reply #9 on: August 01, 2012, 08:07:43 AM »
Should I instal OpenDCL Or loading *.arx is enough?
loading is enough. but you need also Runtime.Res.dll (if i remember correct)
dll needs to be under autocad paths.
kruuger

stevesfr

  • Newt
  • Posts: 54
Re: rename block with preview
« Reply #10 on: August 01, 2012, 09:10:36 AM »
Glad to help. Attached is a version  which uses ODCL. Note you'll need to install the ODCL Runtime version 6, either that or the Studio if you want to create your own ODCL dialogs. You don't need both as the Studio includes the runtime already.

Save both files into a folder on your support path & have the LSP file loaded. Then the command is RenBlocks. It should open a modeless dialog (i.e. while it's open you can still do other things in the drawing) with a list of block names and a preview. Below the preview is a field to type the new block name and a rename button.

Can not get the lisp to work.   Both files are in support path.   OpenDCL is loaded.  Block directory is in support path.   popdown dialog opens, but is blank with no block names or previews available. What am I doing wrong or what have I failed to do.  (RenBlocks.lsp loaded of course ok.)
TIA, Steve
Can't remember what I'm supposed to forget.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #11 on: August 01, 2012, 09:20:11 AM »
This is to rename blocks already in the current drawing, not to rename DWG files in a folder.

My understanding from the OP was that he'd like to see a preview of the block he wants to rename (unlike only showing its name in the normal rename dialog).

Are you looking for something to allow renaming DWG files in your block library? Or rename the blocks contained inside DWG files in your library? The 1st would be reasonably simple, the 2nd would require some ObjectDBX.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

stevesfr

  • Newt
  • Posts: 54
Re: rename block with preview
« Reply #12 on: August 01, 2012, 09:51:10 AM »
This is to rename blocks already in the current drawing, not to rename DWG files in a folder.

My understanding from the OP was that he'd like to see a preview of the block he wants to rename (unlike only showing its name in the normal rename dialog).

Are you looking for something to allow renaming DWG files in your block library? Or rename the blocks contained inside DWG files in your library? The 1st would be reasonably simple, the 2nd would require some ObjectDBX.

I am clear now.... all is OK.  thanks for clarifications.
Steve
Can't remember what I'm supposed to forget.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: rename block with preview
« Reply #13 on: August 01, 2012, 10:20:33 AM »
Glad you to help.

If you want to see something working with ODCL and external block libraries, see Tim's block library manager as an example: http://www.theswamp.org/index.php?topic=32391.30
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

owenwengerd

  • Bull Frog
  • Posts: 451
Re: rename block with preview
« Reply #14 on: August 01, 2012, 10:53:28 AM »
Should I instal OpenDCL Or loading *.arx is enough?

You should install, then it will load automatically without changing your AutoCAD configuration.