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.

Copy / Paste from fields in Coordinate Bar

Started by MarkX, January 16, 2012, 07:50:38 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Dr PR

Mark,

I can't answer the question with certainty. However, I suspect that copying from the display field will get you only the precision displayed, and not the full precision the program uses. It all depends upon whether the display field or the coordinate variable gets copied.

I am also a bit confused about whether you are suggesting copying just one selected field or all the fields in the coordinate bar.

Phil
DesignCAD user since 1987

Rob S

#16
Correct - The clipboard only gets and pastes what it sees, not the underlying true value to x number of decimal places, so yes, if you want full precision to the clipboard, you must crank it up.

You can verify this by pasting your clipboard into a text dialog or notepad, and then turn it up and try again, you will get more digits.

I was also trying to make a macro to easily capture the full co-ordinate value, but I can't find any means to directly transfer the value of a variable to the windows clipboard in Basiccad.

Now that would be a good handy feature to have, and if no one else has found a way either, I will add a new topic requesting it!!!!
User since forever

MarkX

Quote from: Dr PR on January 17, 2012, 01:11:56 PM
I am also a bit confused about whether you are suggesting copying just one selected field or all the fields in the coordinate bar.
Hi Phil,

I'm willing to copy one at a time, if that makes the programming easier ;-)

Mark

Lar

Quote from: Dr PR on January 17, 2012, 11:54:05 AM
Lar,

I think the Info Box reference just means that you can find the coordinates of all points in an object. ... etc...

Once I took off my dcad hat I understood what Mark is talking about. My animation program works that way. There is a mode for every type of selection (object, edge, polygon, points) and the coordinate manager shows the x, y and z values for the center of a selection for that mode, which is represented in model space by an axis (handle). You can drag the axis or change the value in the coordinate manager to move, rotate or scale the selection.

Each object also has a permanent axis. It's similar to dcad's selection handles except there is only one, so it's not as powerful as dcad's. You can can locate it anywhere in model space and use the coordinate manager to manipulate it. To do a 'relative' move you have to click at the end of a value and type a math operation (+, - and the delta, or any type of formula).

You can also move, add and select points in much the same ways as dcad's 'point select mode', except the highlighted points have an axis and you can move the set using the coordinate manager.

What had me confused about Mark's request was that he was saying that the handle of 2D objects showed in the info box, but not those for 3D objects when, in fact, the coordinates of handles are not displayed anywhere in dcad. I suggested using a temporary line since you can snap to handles and the coordinates of points in a line do show in the info box.

Lar


DrollTroll

Rob, read the clipboard by reading Sys$(40); put data on the clipboard by writing Sys$(40).

Ex.
x = Sys(300)
Sys$(40) = x

25 years with DesignCAD

paulerens

#20
'<==This macro lets you select a point on the screen and, if you wish, written to the clipboard. 2D and 3D
'===============================================================================================
>SelectEverything    
{
}

If not(Sys(345)) Then  '===Makes all points visible
>PointSelectMode    
{
}
End If

Sys(1027)=4
Precision 10           '===Set at ten places behind the floating point (change as desired)
>PointSelect
{
}
Getxy x1 ,y1 ,z1       '===Reads the coordinates
Sys(36)=2
Message,"x=",x1,chr$(13),"y=",y1,chr$(13),"z=",z1,chr$(13),chr$(13),"Save this coordinates to the clipboard?"
If Sys(1028)= 6 Then
x1$=x1
y1$=y1
z1$=z1

>MultilineTextEditor      '==Written to the screen.
{
 <PointXYZ [x1 ,y1 ,z1]
 <Angle  -0.0000
 <HorizontalAlignment 0
 <Color 255,255,255
 <FillBackground 0
 <DrawBorder 1
 <ColorByLayer 0
 <Width 100.0000
 <LineSpacing   0.0000
 <DrawAs2dText 1
 <Type 0
 <MultiTextString \FArial;\Ch  0;\H1.0000;\b\i\l\sub\sup\A0;\c255 255 255;{}\H2.0000;\c213 0 0;{ x=[x1$]}{\\n}
 <MultiTextString { y=[y1$]}{\\n}
 <MultiTextString { z=[z1$]}{\\n}
 }
>SetHandle
{
<Pointxyz [x1 ,y1 ,z1]
}
>Copy                  '==Written to the clipboard.
{
}
>Erase
{
}
End If
>PointSelectMode    
{
}
Sys(80)=0
Sys(36)=0
Regen

end


Rob S

#21
My version below copies your choice of x,y, or z co-ordinate of the primary handle to the clipboard at maximum precision, which can then be pasted into any DCAD dialog, or to the screen as text.

If you don't want any feedback, you can comment out the message lines to save a keystroke

Seems the sys$(40) function sometimes jams the clipboard, if it does, copy and paste something else, and try again


'macro to get co-ordinates of primary handle by Rob_S


If sys(34) = 0 then

message "You must select an object first"

end

end if


Sys(800) = 0
sys(36)=2

precision 16

prompt$ = "Get co-ordinate of last selection handle - enter X, Y, or Z"


Input [prompt$], TS$

If TS$ = "X" then goto getx
If TS$ = "x" then goto getx

If TS$ = "Y" then goto gety
If TS$ = "y" then goto gety

If TS$ = "Z" then goto getz
If TS$ = "z" then goto getz

end

getx:

sys$(40) = sys(190)

Message "X-coordinate of handle ", chr$(13), sys(190), chr$(13), "has been copied"

Anykey

end

gety:

sys$(40) = sys(191)

Message "Y-coordinmate of handle ", chr$(13), sys(191), chr$(13), "has been copied"

Anykey
end

getz:

sys$(40) = sys(202)

Message "Z-coordinmate of handle ", chr$(13), sys(202), chr$(13), "has been copied"

Anykey

end

User since forever