DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Blocks in 3D

Started by Dr PR, December 17, 2012, 12:10:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

Minstrel,

In terms of block-find-and-replace, everything is understood.  You and I are on the same page.  Just for information, see my jpgs below for the nested block you create when block overwriting in DC.  The "Master" holding the embedded "Cone" block is what I call the wrapper block.  DesignCAD is doing this when you don't explode the pasted block and redefine.  You said you immediately proceed to block define after pasting. This is OK and rather interesting. 

Finally, tried substituting one of your nested blocks (3rd jpg) into drawing A; everything is fine in DC but doesn't import into SU.  Maybe it's on my end.


For anyone else trying to follow this topic, the images are in SketchUP.  They have an outline tool which shows block nesting. 

prl

Minstrel, this is funny.  I did the nested block copy to drawing A, pasted it, exploded it top-level only (since I couldn't get the other way to export), then immediately redefined it to overwrite "Master" and that makes the proper export drawing.   See jpg 4.

Basically this is how Phil will do his method, copying over items and block defining them from scratch. 

minstrel

There you go!

I get it...you just don't want to make that trip into town to see my 'ScreenCast'!

Yep, that's one way to do it.  I just 're-define' the 'Master' [which has just been modified in this case] back to the name of the original copied/pasted block - nothing exploded... sort of settles the dust for the SketchUP import. 

But, even though it works, it is not ideal, nor perfected.  Yet, we are getting there, don't you think?

Minstrel



prl

#48
Quote from: minstrel on December 26, 2012, 02:53:38 PM
Yep, that's one way to do it.  I just 're-define' the 'Master' [which has just been modified in this case] back to the name of the original copied/pasted block - nothing

Looks like your "Box-Pyramid-Cone_Nest2" is corrupted since it doesn't have the blocks below it (box, cone, pyramid).  Did you flatten out that block or is this SketchUP truncating the last level? In SketchUP when you double click inside that component, are the cone, pyramid, a cube simply SketchUP entities?

I would have expected:

<333.dwg>
       <Master>
                <box-pyramid-cone_nest2>
                           <box>
                           <cone>
                           <pyramid>

minstrel

None of the above...just another experiment... with no joy as of yet.

But you got keen eye's there, Mister!  Me, now I've got sleepy eye's... It's on it's way towards 1am and I'm out of here for the night!

Later,
Minstrel

prl

Minstrel,

Folks here probably think I'm only focusing on exporting to SU but my goal is to determine if DesignCAD blocks are safe to use within DesignCAD.  Earlier I mentioned a corruption issue if blocking, unblocking, and reblocking.  Attached is a dcd drawing where blocks have gone bad.  See if you can retrieve the blocks or tell me what I did to make this mess.

The drawing looks empty but using the infobox, or Help drawing info command, it shows there are 7 blocks in this drawing.  Try using the block insert command?? Look at layers 161 to 164, I have blocks on those layers.  Put yourself in point select mode and select all.   I see the block insertion handles.

minstrel

#51
Nope...I can't salvage this one.  You've just been a bad boy or something. 

Did you use one of your 'mega' macro's durning the process?  Or added a password to the layer(s) somehow?

The fact no 'blocks' are in either 'block define' or 'block insert' from the get-go spells doom right there.

Using the 'Selection Filter' to select them fails.

Used point select and then went with another 'block define' of the selection...it defined a block, but changed nothing.  So, this did not work. 

Then 'purged all unused blocks' and DesignCAD instantly crashed.

Since you are the only one who can retrace every step that you made in the process [to fall into such a dark pit] please try to locate it and report. 

Minstrel

prl

Quote from: minstrel on December 27, 2012, 04:55:58 AM
Did you use one of your 'mega' macro's durning the process?  Or added a password to the layer(s) somehow?

Yes, automated.  What you and Phil are trying to do with "showroom" master drawings, I'm am exploring with "showroom" parts directories.  Not sure what I did, my code did, what DesignCAD did etc.

DrollTroll

I don't know how it got this way, but it looks like the contents of the Symbols stream have been stripped out of the drawing file. Also, some of those blocks appear to be legacy version-13 blocks (perhaps the first version to use blocks? I don't recall precisely). Any previous versions of the drawing we can look at? Any idea of the drawing's history?
25 years with DesignCAD

prl

#54
Quote from: DrollTroll on December 28, 2012, 08:45:49 AM
I don't know how it got this way, but it looks like the contents of the Symbols stream have been stripped out of the drawing file. Also, some of those blocks appear to be legacy version-13 blocks (perhaps the first version to use blocks? I don't recall precisely). Any previous versions of the drawing we can look at? Any idea of the drawing's history?

It was generated recently within the past few weeks with either 17.2 or 22.0 using a basiccad component (block/symbol) loading routine that I'm trying to perfect.

Because DesignCAD has issues with the symbol load/merge name cache,  I have to delete existing blocks and purge the drawing then close the drawing and reload it to reload the components.  The block purge command which is for both blocks and embedded symbols sometimes causes strange issues.  Drawings goes blank even though things are there.  Normally a save and reload will restore the visible items. In this case it didn't.

I don't know the specific sequence I used for this drawing but it was a test drawing that loaded, unloaded, purged and reinserted a wide variety of the same parts.  Sometimes as "merged" items having blocks, sometimes as an "embedded symbols" containing blocks, sometimes as "externally referenced symbols" containing blocks etc.  I suspect at some point the purge didn't work or the various reloadings mashed the names internally. 

I'll keep an eye on things and if I can pin down when things go wrong, I'll let you know.

Also since you are reading this,  DesignCAD (any version) can't reliably create a three deep nested block for export.  Within DesignCAD it can but upon exporting and reimporting in DesignCAD (or any other program such as SketchUP or AutoCAD) via dwg/dxf, it sorts the blocks in the wrong order and you get the top most level block being defined too early in the export data stream.  As such it references nested blocks that haven't yet been defined which results in missing pieces.


Dr PR

DT,

When I started this thread it was just to post things I learn about blocks. To my delight it has developed into a good discussion of blocks, but it certainly isn't a good guide to using blocks. Perhaps it should be moved from "Tips and Tricks" to the "General Discussion" section.

Also, this discussion has brought up a lot of potential ways to use blocks (nested, as parts of symbols, etc.) and has shown some links or common features of blocks and symbols. The Reference Manual really doesn't help much with these complex relationships. Perhaps you can answer some questions:

1. Are nested blocks legitimate?

2. If so, when a nested block is pasted into a drawing how are block names resolved? For example, suppose the original nested block contains a block called "block 1" that was formed from a green cube. The nested block is called "nested block 1."

What hapens if "nested block 1" is pasted into a drawing that already has a "block 1" that was formed from a red cylinder? Will the "block 1" within the nested block remain a green cube, or will it become a red cylinder?

3. What happens to the block container when a block is moved from layer A to layer B? Does the container move with the block to layer B or does it stay on layer A?

What happens to the containers of a block nested inside another block when the nested block is moved to another layer?

4. What is the relationship between blocks and symbols?

5. Is there a way to replace "block A" with "block B"?

Phil
DesignCAD user since 1987

prl

#56
Quote from: Dr PR on December 28, 2012, 02:16:21 PM
3. What happens to the block container when a block is moved from layer A to layer B? Does the container move with the block to layer B or does it stay on layer A?

I know you are asking DT.

For your item 3, the way I understand it, the block is the container.  When you move the block to different layers, the block=container is moved there.