News:

Please note new Forum URL: forum.designcad.com

Main Menu

push-apart drawing components

Started by Dempsey, September 17, 2008, 10:58:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dempsey

PURPOSE
To "push" the components of a 3D wood-working drawing apart such that the individual components are fully visible and dimensions can be added. Usually this one drawing is sufficient for constructing a wood-working project instead of multiple 2D drawings (front, side and top).

USAGE

  • Select one or more components (groups, solids, entities).
  • Start this macro which will prompt for three inputs and then execute.
  • NOTE: The Move/Copy "From Reference Point" flag will be UNCHECKED!!!

INPUTS

  • Push-apart centre -- O: drawing origin (0,0,0), C: centre of selected objects, P: point to be set by user
  • Direction(s) of expansion -- X, Y, Z, XY, XZ, YZ, XYZ
  • Expansion Percentage -- nn.nn, -nn.nn
    The center of each selected component is pushed that percentage further from the push-apart centre in the direction(s) of expansion. A positive expansion (e.g. 25%) can be reversed by doing the same but negative expansion (e.g. -25%).

LIMITATIONS

  • The selection cannot have more than 32767 entities due to the BasicCAD limitation of the Dim statement.
  • The pushapart macros don't work properly while in Animation mode. See reply further down for the details.
  • The pushapart.d3m macro uses PUTATTR to select components, and could be slower than the pushapart2.d3m which uses >PointSelect to select components. However, I have not been able to measure that to proof it one way or the other. An example drawing is attached.

For the development discussions see http://forum.designcad.com/index.php?topic=1535.0, where I got lots of help. Thanks everyone.
Dempsey

bdeck

Hi Dempsey,

I finally got a chance to use your push-apart macro to adjust spacing in a file used to generate a textile cutting cnc file.

Very useful.

Thanks,

BD

Dempsey

Hi everyone,

I discovered that the pushapart.d3m and pushapart2.d3m macros would not successfully complete when the Move/Copy "From Reference Point" flag is checked.

The revised macros now make sure that the flag is unchecked. The new macro versions can be downloaded from the the opening topic.

Dempsey

magic

Hi Dempsey,

I am very impressed with the push apart macros, and I have used and demonstrated them on a number of occasions.

So I thought, genius as I am, that it would be ideal to make an animation using the push apart macros, but this does not seem to be possible.

It's as if DesignCAD selects all as one entity and moves that and also it seems to sometimes trigger the "Record a key frame" button.

I have made a little film, www.magicsystems.com/pushapartanimation.htm, but you'll probably want to test it yourself.

Thank you very much.
It's a kind of magic!




Dempsey

Hello magic,

Thanks for pointing this out. I tried it myself and it looks like the Animation recording is interfering with the macro execution. I will have a closer look at it, but that can take a while as I am still in "catch up" mode.
Dempsey

Dr PR

#5
Dempsey,

I tried using the pushapart.d3m and pushapart2.d3m macros on a 27 Mbyte drawing in V21.0. Both crashed DesignCAD.

The macros never got around to asking me for input - they crashed immediately after I executed them. If I don't select anything the macros terminate correctly.

The drawing has a lot of groups composed of several solids. The solids are like pieces of broken coconut meat - parts of spherical surfaces on the inside and out with flat sides. Not too complex, but not simple rectangular cross section pieces either. The parts of the drawing are on several layers.

The macro text says to uncheck "Move/Copy from reference point." I cannot find any such option. Where is it? Also, I have no idea where to find the "ShowValues" flag.

I tried your pushaparttest.dcd file on both my XP and Vista machines with V21.0 and the macros work OK on both machines. There is something about the larger file that they don't like.

Phil
DesignCAD user since 1987

Dempsey

Phil,

Let's stay with pushapart.d3m for the time being.

The unchecking of the "Move/Copy from reference point" I take care off in the macro code. You can set that flag yourself in the pop-up submenu of the move or copy command.

The flags are controlled with the following code:

  SYS(36) = 2       ' silent mode
  ShowValues = 0    ' user flag; set to 1 to view values
  DebugFlag = 0     ' user flag; set to 1 to view each completed step

You will find those immediately following the comments at the top of the macro. Would be interesting to find out where the macro crashes, and playing around with each of these flags might give some clue.

Although I am not sure I can handle a 27MB drawing, you can zip your dcd file and put it on a website from where I can download it. I can handle at least 10MB as an email attachment.
Dempsey

Dr PR

Dempsey,

Sorry, I can't release that drawing.

Phil
DesignCAD user since 1987

paulerens

Dempsey,
I've admired your Marco.
my hat.
Paul.

Dempsey

Phil, any other drawing that fails in the push-apart and that you can share? I suspect that it is a size issue.

Paul, thanks. With 40 years of software experience it was not difficult; I just needed to understand how to use the BasicCAD functions.
Dempsey

paulerens

#10
Dempsey,
QuoteShowValues = 0    ' user flag; set to 1 to view values
Where to find this ....code?
Paul.

Dempsey

Paul,

See http://forum.designcad.com/index.php?topic=1582.msg21314#msg21314. It is in the macro itself immediately after the beginning comments.
Dempsey

Dr PR

Dempsey,

I have used it with small drawings and it works nicely. I'll watch for a larger drawing that causes problems and send it.

If it is just a file size problem you can use Select All, Replicate, Select All, Replicate ... etc. to generate very large files quickly for testing.

Phil
DesignCAD user since 1987

Dempsey

Phil,

During my testing trying to figure out what is causing the crash when you try to push apart your large drawing I found that pushapart.d3m is 3 to 4 times slower than pushapart2.d3m!!!

I use arrays in the macro that are sized according to the number of selected entries and those are defined before the dialogue with the three questions. My gut feeling is that a dimension setting in BasicCAD has a limit of 32768 or 65536, I don't know a way to work around that.

I have a test drawing now with 27,358 entries and it works fine. It does take 16 minutes with pushapart2.d3m.

How many entries do you have in your large drawing?
Dempsey

Dr PR

Dempsey,'

I have no idea how many entities were in that drawing. It has been edited and is now about 50 Mbytes, with 77,277 entities. It's a pretty good bet that it was more than 32K entities at the time.

Phil
DesignCAD user since 1987