Author Topic: Redefining Blocks  (Read 6801 times)

0 Members and 1 Guest are viewing this topic.

MikePerry

  • Guest
Redefining Blocks
« Reply #15 on: November 11, 2004, 02:50:25 AM »
Quote from: ML
No, I am not exploding it because there are no objects to explode but someone else recommended the expert variable, or may be you did earlier

Hi

Therefore you're creating a Block (with the same name as your DimStyle drawing file) within the drawing file when Inserting.

There's nothing wrong with that, but you need to be aware that if you then ReInsert DimStyle drawing file without first Purging the Block (with the same name as the DimStyle drawing file) from the drawing file you will have to deal with the "Block already defined. Redefine it?" (BLOCK) and "A drawing with this name already exists. Overwrite it?" prompt.

That is why I suggested maybe looking at the system variable Expert.

Personally I would go with Pre Exploding DimStyle drawing file when Inserting.

If it's still not working can you please post your DimStyle drawing file and Macro for Inserting the DimStyle drawing file so we (I) can see exactly what is going on; without seeing these I'm really struggling to see what could be causing your problem.

Have a good one, Mike

ML

  • Guest
Redefining Blocks
« Reply #16 on: November 11, 2004, 06:46:25 AM »
Hi Mike,

The maco is real simple, it ^C^C-insert;filename;0,0;;;;z;e;

I am going to try that Expert Variable :

 ^C^C(setvar "expert" 2)-insert;filename;0,0;;;;z;e;(setvar "expert" 0)

and Keith also offered a very good suggestion if you read back a few posts about needeing the whole path in tthe macro in order to redefine

I will try both ideas and see what happens

Thanks again

Mark

CADaver

  • Guest
Redefining Blocks
« Reply #17 on: November 11, 2004, 08:38:30 AM »
Quote from: ML
Hi Mike,

The maco is real simple, it ^C^C-insert;filename;0,0;;;;z;e;

I am going to try that Expert Variable :

 ^C^C(setvar "expert" 2)-insert;filename;0,0;;;;z;e;(setvar "expert" 0)

and Keith also offered a very good suggestion if you read back a few posts about needeing the whole path in tthe macro in order to redefine

I will try both ideas and see what happens

Thanks again

Mark



Okay, one last time.

Code: [Select]
-insert;filename;0,0;;;;z;e;

The above code works if AND ONLY IF, the block <filename> does not already exist in your drawing.  If the block <filename> is already in your drawing IT WILL NOT INSERT THE REDEFINED DIMSTYLES, it will merely insert the definition that already exists in the drawing, and that definition has no dimstyles associated with it.  

Try:
Code: [Select]

^c^c(command "-insert" "<BLOCKNAME>=<FILENAME>" "y" (command))


Where <BLOCKNAME> is the name of the block in the drawing, and <FILENAME> is the name of the file yopu're attempting to insert.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Redefining Blocks
« Reply #18 on: November 11, 2004, 08:48:48 AM »
also it makes absolutely no difference if the block has anything drawn in it or not. If you insert it as a block it will always be a block in that drawing. Therefore it is advisable to insert it as an exploded block.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CADaver

  • Guest
Redefining Blocks
« Reply #19 on: November 11, 2004, 08:52:30 AM »
Quote from: Keith
also it makes absolutely no difference if the block has anything drawn in it or not. If you insert it as a block it will always be a block in that drawing. Therefore it is advisable to insert it as an exploded block.
Flogging expired equine, methinks.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Redefining Blocks
« Reply #20 on: November 11, 2004, 08:55:06 AM »
Ok, This code works like this:
Code: [Select]
^C^C(COMMAND "INSERT" "DimStyles=DimStyles.DWG" "0,0" "1" "1" "0" "._erase" (entlast) "" "._purge" "B" "DimStyles" "N")

Inserts DimStyles.DWG as a block, if the block exist it replaces it.
The path is not needed IF DimStyles.DWG is in the ACAD search path.
"._erase" erases the last entity added to the data base
"._purge" removes th block just inserted.

All the dimensions styles are left in the drawing.
 IF the style already exist it is NOT over written.


Quote

Command: _vlide INSERT Enter block name or [?]: DimStyles=DimStyles.DWG
Duplicate definition of block _ArchTick  ignored.
Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]: 0,0
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>: 1 Enter Y
scale factor <use X scale factor>: 1 Specify rotation angle <0.0000>: 0
Command: ._erase
Select objects:   1 found

Select objects:
Command: ._purge
Enter type of unused objects to purge
[Blocks/Dimstyles/LAyers/LTypes/Plotstyles/SHapes/textSTyles/Mlinestyles/All]:
B Enter name(s) to purge <*>: DimStyles Verify each name to be purged? [Yes/No]
<Y>: N Deleting block "DimStyles".
1 block deleted.

Command:
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.

ML

  • Guest
Redefining Blocks
« Reply #21 on: November 11, 2004, 10:20:29 AM »
Code: [Select]

^C^C(COMMAND "INSERT" "DimStyles=DimStyles.DWG" "0,0" "1" "1" "0" "._erase" (entlast) "" "._purge" "B" "DimStyles" "N")



And CAB Wins! What do we have for him Johnny?  :D

That was the answer, thank you very much!

Any blocks that I insert, titleblocks and all are always in a Support Path. I do not like typing whole paths into a menu file if necessary.

One last thing, after the DimStyles.dwg drawing is inserted, it opens The Dim Styles dialog box and it takes 4 Manual Escapes to supress it. I need to supress it via code

Thank you

Mark

ML

  • Guest
Redefining Blocks
« Reply #22 on: November 11, 2004, 11:21:52 AM »
Ok, Thanks again CAB, it works perfect!!

I had a few Esc (^C) returns at the end of the macro which is why the dialog was coming up.

Now, it is great!


Mark

ML

  • Guest
Redefining Blocks
« Reply #23 on: November 11, 2004, 11:47:46 AM »
Sorry, I meant enter, enter ;;