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.

Scaled details

Started by GooPie, March 16, 2015, 08:44:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GooPie

Good Morning

Here is a macro to enlarge (double the size) of a portion of a drawing:
How to have fixed dimensions of the same size?
See attached file.


Is this possible without having to individually edit each dimension and check (in the infobox) the case "fixed text"?

I looked if there was a sys function to do that but I don't found  :(


'-------------------------------------------------

'scaled details (*2).d3m


SYS(996) = 1
' stop macro with Esc or cancel

IF SYS(80) = 0 THEN
MESSAGE "Select something and restart the macro."
END
ENDIF

x=sys(190)
' x1 selection coordinate

y=sys(191)
' y1 selection coordinate

z=sys(202)
'z1 selection coordinate

>SelectDuplicate
{
  <PointXYZ [x,y,z]
  <Type 1
  <Reference 0
  }

>SelectScaleOrtho
{
  <ZoomFactor 2.0000
  <Type 0
  }

>SelectMove
{
  <Type 1
  <Reference 0
  }

END

'-------------------------------------------------

JJG

OK,
in this topic, I gave the code of such a macro : http://forum.designcad.com/index.php?topic=6055.msg42927#msg42927

Indeed, my side I use the following macro to duplicate a selection, to apply to it a scaling factor and correct in the same time the scale factor of hatches and dimensions which are in the selection ; also, I don't explode the dimensions, just give them a multiplier automatically through the macro.
In addition, the reference points of the selection are kept identical to the original.
It's very useful for creating scaled details or downscaling of a part of the drawing for printing (for those who don't like the paper space).

Note: working through groups and "unproper solid" without having previosly to "unmount" them ;
is also working on the hatches contained in blocks or symbols without having to break them ;
however, does not work on dimensions contained in blocks or symbols: in this case,
it's necessary to break the blocks or symbols before running the command.

enjoy !

Note that you are using Designcad Pro 6000, which is v15.33 (french, that I have use too in the past) : in this version, dimensions are the old ones, ie since v17, they are "new" (or Designcad Pro 7000 for french version = v18.35 ; now we are at Designcad Pro 9000 = v23.11).
I don't remember if I've updated this macro or not, ie if it's compatible with v15 or no more ??? Try it please !

'This macro is used to duplicate a selection, to apply to it
'a scaling factor and correct in the same time the scale factor of hatches
'and dimensions which are in the selection ;
'In addition, the reference points of the selection are kept identical to the original.
'very useful for creating scaled details or downscaling of a part of the drawing.

'Note: working through groups and "unproper solid" without having previosly to "unmount" them ;
'is also working on the hatches contained in blocks or symbols without having to break them ;
'however, does not work on dimensions contained in blocks or symbols: in this case,
'it's necessary to break the blocks or symbols before running the command.

Alias H_SCALE &H0803
Alias D_UNITS &H0A1C
Alias D_MULTIPLIER &H0A1D

begin:
If sys(80)<1 then goto fin

INPUT "Zoom Factor   (Esc to quit)", ZoomF
IF sys(999) THEN End 'stop macro if Esc or cancel

sys(996) = 1         'stop macro if Esc or cancel
sys(36)=2 'super silent mode on

a=sys(242) 'store select when created statment
sys(242)=0 'do not select when created

Sx=sys(190)  'x1 coordinate of the selection
Sy=sys(191)  'y1 coordinate of the selection
Sz=sys(202)  'z1 coordinate of the selection

Duplic: 'duplicate with selected when created and update the handles
>SelectDuplicate
{
  <PointXYZ [Sx,Sy,Sz]
  <Type 1
  <Reference 0
  }

>SelectScaleOrtho
{
  <ZoomFactor [ZoomF]
  }

sys(36)=0 'super silent mode off

>Move
{
  <MaxPoints 1
  <incomplete
  }

sys(242)=a 'restore initial statment of selected when created

sys(36)=2 'super silent mode on

Count=Sys(80) 'for ProgressionBar

For t=1 to Sys(80)
getselect t,j
Entity j
'ProgressionBar
if maxi<Count then maxi=Count
Current=Count
Query H_SCALE, f
g=f*(ZoomF)
if ZoomF>1 then g=f
Change H_SCALE, g
Change D_UNITS, -1
Query D_MULTIPLIER, d
'mes$=d
'message mes$
x=d/ZoomF
Change D_MULTIPLIER, x
update
Count=Count-1
pr=int(((maxi-current)*100)/maxi)
print STRING$(pr, "#")
next j

sys(36)=0 'super silent mode off

>redraw
{
}

End.

fin:
inf$="please select something and then restart the macro"
message inf$
End

GooPie

#2
JJG thank you for sharing.
I'll test your macro and coming back to you.

In reading your code, I'm a little (a lot) lost.

:o :o :o :o
Alias H_SCALE &H0803
Alias D_UNITS &H0A1C
Alias D_MULTIPLIER &H0A1D
:o :o :o :o


Yes I am using an old version of DesignCAD and only in 2D.
I started with version 7 (French) and I did the updates up to version 6000.
One day I will think to do an update.

Edit :
I just test your macro, good idea to ask a zoom factor.
The result is attachment. There is unfortunately no different than what I get with my macro.
I'll go to sleep thinking about how to solve.

PRL was right ...
BasicCAD Can! BasicCAD Can! BasicCAD Can! BasicCAD Can! . . . . now try to sleep,  impossible.

GooPie

#3
I find a solution by first converting the Dimension To Text.
Proceeding in this way I keep the same dimensions.
It's not perfect but it's better than nothing.


Edit 24/03/2015 (22:17) :

Here is the macro that can do it

'Convert dimension to txt2D.d3m

Nouveau:

FOR J = 1 to sys(9)

GETATTR J, type, select, laynum, group, red, green, blue

IF type = 75 THEN
' If item is a Dimension

select = 1
' Select the Item

PUTATTR J, type, select, laynum, group, red, green, blue

>Explode   
{
}   
' Explode the Item

GOTO Nouveau

ENDIF

NEXT

END

JJG

GooPie,

I re-installed Designcad pro6000 to test again, and indeed, the "D_MULTIPLIER, d" command don't work with your version of Designcad : it's appeared with version 17 (or Designcad pro7000 for the french version, which is a 18.3x version).
And, yes, I remember that in such cases, I've ever checked one to one the "Texte figé" (i.e. "Fixed Text"), in order not to lost the "dimension" type of theses entities.
But for me, it was never more than ten or twenty dimensions, what was feasible or conceivable.