Author Topic: Construction Line Redo  (Read 66 times)

Gymbo

  • Jr. Member
  • **
  • Posts: 68
Construction Line Redo
« on: April 06, 2018, 01:41:58 PM »
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: [Select]
'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

Edit: 4/7/2018 to add display width or drawing width
« Last Edit: April 07, 2018, 10:45:08 AM by Gymbo »
Regards,

Jim