TheSwamp
CAD Forums => CAD General => Topic started by: ML on November 10, 2004, 08:53:57 AM
-
I have a blocked out drawing (Dim Styles to be exact). If I purge out the dim styles, then re insert this drawing via the insert command, it asks me
if I want to redefine the block, I say yes, all is well.
Now, I have a macro that is started ^C^C-insert etc. etc.
The macro works fine, the drawing inserts "but" my dimstyles are not there. This is the problem.
So, is there a way to redefine the block via command line. Is it even necessary? Or, is there another problem that I don't know about?
Thank you
Mark
-
Look here
http://theswamp.org/phpBB2/viewtopic.php?t=977&highlight=insert+replace
-
Hi
What exactly do you mean by "my dimstyles are not there" -
New Dimstyles simply don't load
New Dimstyles don't overwrite existing Dimstyles that share the same names
Something else
Maybe take a look at the system variable Expert when running your command macro.
Have a good one, Mike
-
I have a drawing that contains The DIMstyles only.
We Insert if we need the DimStyles
-
If you insert a block that already exisits in the drawing it will prompt you to redefine and you need to answer YES to get the dimstyles. Check the command syntax and adjust your code accordingly.
-
Yes, I am aware of that CAD but I am inserting the wblocked (Dim Styles drawing) via a macro
It appears to be inserting just fine but the Dim Styles are not
What do you think?
Mark
-
Hi
Could you please post your DimStyle drawing file and Macro for Inserting the DimStyle drawing file.
Does the Insertion of the DimStyles always fail, doesn't matter if you -
Insert into an existing drawing file
Insert into a new drawing file
Have a good one, Mike
-
Hey Mike
If I insert into a new drawing, it is fine. It is if the Dim Styles are not used, then purged out
Then, I re insert the Dims drawing and that is where they are not showing up
Mark
-
Hi
Are you bringing in the DimStyle drawing file as a Block (ie Not Exploding on insertion) OR Exploding on insertion?
If as a Block, maybe look at setting system variable Expert = 2 before bringing in.
OR
Try bringing it in Pre Exploded instead.
Have a good one, Mike
-
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
Doesn't this expert variable do more then what we may want?
May be I will build (setvar "expert" 2) insert my block then (setvar "expert" 0)
here is how it effects blocks --->
Suppresses the preceding prompts and "Block already defined. Redefine it?" (BLOCK) and "A drawing with this name already exists. Overwrite it?" (SAVE or WBLOCK).
-
You can use this it will purge the block but leave the dims in the drawing.
This is one line so when you paste it into a botton make sure ther are no ^M; added by ACAD.
If your block dwg is in the ACAD path you don't need the path.
^C^C(COMMAND "INSERT" "DimBlock=Dim-Style.DWG" "0,0" "1" "1" "0" "._erase" (entlast) "" "._purge" "B" "DimBlock" "N")
-
Mark, your latest post provides a bit more info, the block is not exploded, does not contain graphical objects and as such cannot be purged UNLESS you delete the block, which you can only do with code.
You CAN redefine the block, but only if you insert it from the hard drive file, not by simply re-inserting it. You have to provide the entire path to the file on the HD in order to redefine it.
-
INSERT
BLOCK A= BLOCK B
ENTER
ENTER
????????????
-
Hey Keith
Thank you for the reply.
I am actually able to purge the dim styles out of the drawing but according to what you are saying, I will need to enter the entire path into the menu macro, is that correct?
Thank you
Mark
-
In other words
^C^C-insert;entire path including filename;
-
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
-
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
-
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.
-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:
^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.
-
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.
-
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.
-
Ok, This code works like this:
^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.
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:
-
^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
-
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
-
Sorry, I meant enter, enter ;;