News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

Orientation

Started by roger_c130, April 15, 2008, 04:17:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roger_c130

I like to see (on screen) the geographical position of XYZ Reference lines that can be attached to a given point on a solid for displaying the angle of each line in respect to the system's compass points.  Would help tremendously getting drawing into the next position for work.

prl

#1
A good feature request.  Until they create it, here is a macro that may be useful.


'Program: xyzhere.d3m

sf = .25 'scale factor for arrow and text size. Fiddle with this to your liking

'save various settings
cl = sys(3) 'current layer
ts = sys(12) ' current text size
cred = sys(300) 'current red value
cgrn = sys(301) 'current green value
cbl = sys(302) 'current blue
cctf = sys(254) 'current color text flag
ccfl = sys(255) 'current color layer flag
pspm = sys(1116) 'preset point mode'

sys(1116)=0 'preset point mode off for sphere rubberband
sys(41) = 18 'sphere rubberband
sys(36)=0

SetPoint "Set 1st point xyz symbol center,  2nd point for xyz symbol size", 2
pointval x,y,z, 1 'store first point only

sys(36)=2 'hide the dialogs
>sphere
{
  <Latitude 5
  <Longitude 5
  <Orientation 0
  <UsePresetPoints
}

entity sys(9) 'get coordinates of sphere just drawn
pointval cx,cy,cz, 1
pointval ex2,ey2,ez2, 3
sys(1)=0

dx = ex2 - cx
dy = ey2 - cy
dz = ez2 - cz
d = dx * dx + dy * dy + dz * dz

if d = 0 then goto restore
d = sqrt(d)
sys(12) = sf*d

as = sys(12)

>eraselast
{
}

sys(3)=999 'switch to empty/junk layer, say 999'
sys(254) = 1 'turn on
sys(255) = 1 'turn on

sp1 = sys(9)+1
>arrow
{
  <Color [sys(334), sys(335), sys(336)]
  <Type 4
  <Size [as]
  <pointxyz [x,y,z]
  <pointxyz [x+d,y,z]
  <Doublesided 0
}

>Text2d
{
  <Color [sys(334), sys(335), sys(336)]
  <pointxyz [x+d,y,z]
  <Style 0
  <Justification 0
  <Angle 0
  <Text "x"
}

>arrow
{
  <Color [sys(337), sys(338), sys(339)]
  <Type 4
  <Size [as]
  <pointxyz [x,y,z]
  <pointxyz [x,y+d,z]
  <Doublesided 0
}

>Text2d
{
  <Color [sys(337), sys(338), sys(339)]
  <pointxyz [x,y+d,z]
  <Style 0
  <Justification 0
  <Angle 0
  <Text "y"
}

>arrow
{
  <Color [sys(340), sys(341), sys(342)]
  <Type 4
  <Size [as]
  <pointxyz [x,y,z]
  <pointxyz [x,y,z+d]
  <Doublesided 0
}

>Text2d
{
  <Color [sys(340), sys(341), sys(342)]
  <pointxyz [x,y,z+d]
  <Style 0
  <Justification 0
  <Angle 0
  <Text "z"
}

for j = sp1 to sys(9) 
  getattr j, type, select
  putattr j, type, 1
next j
>groupdefine
{
}

gosub restore



regen
end

'subroutines follow

restore: 'restore settings
sys(36)=0
sys(80) = 0
sys(3)= cl
sys(12) = ts
sys(41)=0
sys(1116)=pspm
sys(300)=cred
sys(301)=cgrn
sys(302)=cbl
sys(254)=cctf
sys(255)=cclf
return