DesignCAD SDK > User Contributions

Construction Line Redo

(1/1)

Gymbo:
This macro place a blue dashed construction line on layer seven and scales the style based on the x scale of the drawing then returns to the working layer with the working line type, scale and color, works reasonably well from very small to about 100 feet.


--- Code: ---'create construction line on layer 7
a = sys(601) 'max x display
b = sys(600) 'minimum x display
c = a - b
x = sys(122) 'max x value
y = sys(120) 'min x value
z = x - y
sys(1009) = 1 'make Constr line visible
CL = sys(3)  'current layer
LT = sys(4) 'current line type
LS = sys(5)  'current line style

if z > c then z = c 'use a
if z < 10 then 'log of a negative number
sl = 0.1
goto here
end if
sl = (ln(z-8)-1/ln(10))/2
here:
>ConstructionLine
{
  <Color 128,128,255
  <Layer 7
  <LineStyle 1,[sl],0 '0.3 was sl
  <Type 0
}
sys(3) = cl
layer(7) = 6
sys(4) = lt
sys(5) = ls
sys(26) = 0
End
--- End code ---

Edit: 4/7/2018 to add display width or drawing width

Navigation

[0] Message Index

Go to full version