Convert Block to Xref
What recommended procedure for converting a Block to an Xref?
I have numerous instances of a Block, carefully snapped to locations and rotated in various angles; the whole would be laborious to re-create.
I should ideally like to convert all of them from a single Block to a single Xref of same name but of course transferred to a new dwg, e.g. by simply re-pathing one of them.
So far I've only found a complex route, followed by having to reconstruct the whole locations and rotations layout as described. One problem is that if there's a Block in a dwg, it won't allow me to insert an Xref of same name.
Any chance?
Comments
-
Hi Tom,
If you have BricsCAD Platinum or greater, then you can:
- Use BMMECH to temporarily convert the blocks to components
- Then in the Mechanical Browser you will find an option to "Switch all to External", this will write the components out to file (xref).
- Having done this you can use BMUNMECH to convert the components back to simple xrefs.
May sound like a few steps, but it is quite quick to do.
Regards,
Jason Bourhill
CAD Concepts0 -
Is it possible to just replace Block Instances parent Block with
another Block, while keeping Instances Position/Rotation/Scale ?In Architecture and BIM Exchange, you often deal with these Anonymous Blocks.
Thought as created from a "Block Template" while each Instance can have
different Settings.
In reality in many cases these Anonimous Block Instances could or should just
be standard Blocks as their Instances are all exactly the same.
And Anonymous Block-ing by n-times Blocks just prevents from applying
changes to, say 20 exactly same Windows or Columns.So,
could I select a bunch of "different" Block instances and force them
to accept a new Block definition ? Like :
Block001 to Block 153, to get Block097 assigned ?0 -
Jason, I have BricsCAD BIM - can't remember if that incorporates the relevant powers of Plat?
Anyway, in a copy of the dwg, BMMECH and Mech Browser are available.
I pick one instance of one of the Blocks, go BMMECH>Yes. (should I have selected all instances of that Block? should I have opened it in Refedit?)
Now none of the Blocks can be opened in Refedit - says all instances of all the Blocks are all now Anonymous Blocks.
In Mech Browser I don't see any option to "Switch all to External".Grateful if you could provide a bit more stepwise detail.
0 -
@Michael Mayer
Yes, these useless, identical block definitions are a nuisance. Merging them via Lisp would be possible, but I probably won't have the time to look into this any time soon (besides, there a better coders around here). If these definitions are completely identical, the task is probably not so hard, but I also encountered a more complicated version of this problem (namely from ifc-import): the blocks are geometrically identical, but numerically different, since all of them have their base point set to world origin. Detecting and correcting this is way over my head, but maybe blockify could once get an option to merge such redundant definitions into one. All I can offer at the moment is a small script that I use to switch block instances to another definition - it will happily switch blocks to an external definition (xref), as also switch anonymous blocks (components) to ordinary block definitions, and vice versa. Hope you can make sense of it...@Tom Foster
Right-clicking the assembly name in the mechanical browser should bring up a menu with the option you are looking for - additionally, there is a BMEXTERNALIZE command.0 -
Thanks Knut !
Yes, any kind of Block from world orgin is a nightmare.
Forgot about that.
But my main question was pretty basic.
Can I replace standard ideal Block's Instance in Drawing,
with proper locations and such,
with any other Block Definition ?
Say Chair01 copies with a Chair02 Block ...Would I really need a script for that in Bricscad ?
Or things like in Drawing Explorer, Blocks,
select and delete a Block, currently in use,
being asked if I want to :
a) delete all its Referenced Blocks
b) explode References and keep plain Geometry
c) Replace Block References with Block : choose from list0 -
Hello Michael,
similar functionality is available for components (BMREPLACE or 'replace all inserts' in the context-menu of the mechanical browser), but not for regular blocks, so your suggestion is a valid feature request.
Another solution would be to open the mechanical browser for ordinary blocks and xrefs, and thus make BMREPLACE available for them.0 -
Ouh, didn't expect that.
So for now and my ability level I will still just explode anything
ACAD Block-ish that I have to work with.
And hope for Blockify.Feature Request, hmmh, yes.
But if I start separating my complaints about the whole Block thing
for proper only-1-Feature Requests, that would mean quite a
bunch of those.
And likely 80+% of these would burst ACAD compatibility.0 -
Hello Michael,
I think the idea to get a pop-up when deleting a block in the explorer - just like when deleting a layer - is a good one that would not break anything, and I hope it will get implemented.
In the meantime, you might try to overcome your aversion to usings scripts...
Instead of asking 'Would I really need a script for that in Bricscad ?' one might ask 'Can I really do such things with scripts in Bricscad ?': Not confining users to a fixed and predefined set of functions, but rather empowering them to create the functionality they need is not a weakness, but one of BricsCAD's strengths!Since I already ran into the use case you described, I decided to quickly soup up my script a bit, and added the option to globally replace all instances of a block, just like BMREPLACE allows you to replace all instances of a component. The attached screen capture shows its workings: You can either replace single instances ('Individual mode'), or all instances of a block ('Global mode'), and switch back and forth between modes by typing I or G. The command is now called XREPLACE, which might be more descriptive.
However, If you want to give it a try, save your work before: I just hacked this thing together, and there will certainly be bugs.
0 -
Already thank you Knut.
I have bookmarked this thread and will have a look at
your solution soon ....0 -
Hello Michael,
maybe look rather at the newly attached version, it has additional functionality:
Instead of selecting a block insertion or choosing a block from a list, you can now also choose a File, and then get the choice to insert it as a block or attach it as xref.
Combined with the 'global' option mentioned earlier, I think that this more or less covers what Tom had initially asked for.0 -
Thanks Knut.
Meanwhile I saw the video.
Looks cool.
Just like a normal worflow I would expect being provided
by the Software by default. I did so for Facade Elements
in VW since years.
Will try the script.0 -
@Knut Hohenberg said:
Hello Michael,I think the idea to get a pop-up when deleting a block in the explorer - just like when deleting a layer - is a good one that would not break anything, and I hope it will get implemented.
Done.
I SR-ed it.0 -
@Knut Hohenberg said:
Hello Michael,
maybe look rather at the newly attached version, it has additional functionality:
Instead of selecting a block insertion or choosing a block from a list, you can now also choose a File, and then get the choice to insert it as a block or attach it as xref.
Combined with the 'global' option mentioned earlier, I think that this more or less covers what Tom had initially asked for.You made me start my first Script in a CAD.
(your 1.0)How do I get rid of v1.0 so that I am able to look at v2.0
(which has the same name)
beside restarting ?0 -
BTW
Support told me today that for now there is alsoalready a BLOCKREPLACE
in "Express Tools" (unfortunately Windows only)0 -
Hello Michael,
I am not sure I understand... so just some general hints on the use of scripts:Usually, you will need to place scripts that come with a dcl-file (dialog box description) in a folder that is in BricsCAD's search path, so the scripts finds its dialog (this can meanwhile be overcome by including special code in the script, but since I write stuff mostly for my own use, I don't need that). So you could just save the files into (e.g. $HOME/Bricsys/BricsCAD/V19x64/en_US/Support), but it is highly recommended to create a dedicated folder instead, and include it in your SRCHPATH (under Settings / Program Options / Files / Support file search path). You can then use the appload command to keep a list of your favorite scrips at your disposal, if you do not want to dive deeper in menu/cui-customization. Scripts can simply be deleted or overwritten by new versions, there is no (de-)installation needed.
As to Blockreplace found in Express-tools, I cannot tell if it has advantages over my script (I am mainly on Linux, and never looked into it), but I guess it has less extensive functionality...
0 -
Yes, I had problems starting my first script.
Yes, I made it work by copying to en_US support folder.Must had a blackout that I didn't have the idea to just
overwrite the old script with the new oneYes, if I do that more often, I should put them in extra folders.
Have to do that for all kinds of Templates, Materials, ... one day
anyway.0 -
Hello (finally) there,
Here is my workflow to accomplish this :
First suppose you have a main.dwg consisting of 10 blocks foo that you want to replace with 10 xref foo.dwg- in main.dwg
1.1 rename foo to foo_
1.2 bedit foo_
1.3. xattach foo.dwg at correct location, rotation, scale
1.4. suppress everything else in foo_ ?!
1.5. _qsave it - in main.dwg again
2.1. select all foo_
2.2. explode them # that's done
2.3. audit (optional, but recommended)
2.4. purge (optional, but recommended)
starts again with bar, baz etc. blocks if needed
Works fine up to there
Oli0 - in main.dwg