News:

Please note new Forum URL: forum.designcad.com

Main Menu

DC 7.0 BasicCAD upgrade questions

Started by myles, January 09, 2007, 01:06:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

myles

Well in another part of the forum I was told to ask questions here so here it goes.

In 7.0 there is a DC command SETLINESTYLE a, b, c, I'm trying to figure out what each parameter corresponds to in 17, which leads to my next problem.


>POINTXY a, b, c ... n followed by >line in presetpointmode  I assumed this was drawing a line, but in 17 the line doesn't take multiple point parameters it takes multiple polar coordinates.

So far the rest has been fairly self-explanatory, but I have a couple thousand more lines of code to go over, so I'm sure I'll be back.

prl

#1
Hurray, we have a post here finally!!

Looks like you are going to draw a line with certain line style.  The new code will look like this:
sys(4) = 2 'see the sys function section and look up sys(4) for which style you want
>line
{
<pointxyx [x1, y1, z1]
<pointxyx [x2, y2, z2]
<pointxyx [x3, y3, z3]
<pointxyx [x4, y4, z4]
'etc.... 
}


Edit: feel free to copy and clip portions of the old code.

myles

Ok, the trouble that I was having was the code is:
SETLINESTYLE 0,2,[(.075*X)]
>pointxy 0, 0, 0
....
n
>LINE

I don't know what each of those parameters in setlinestyle are referring to so that I can mimick it in 17. 

Thanks for your help.

prl

I take it you didn't write the original code.

SETLINESTYLE was introduced in 7 (I guess) and has since been abandoned.  I would guess they are; linetype, linescale, linewidth.  Do you have a running version of DesignCAD 7 with these routines?  You could back into these by seeing what they do.

Mark Laing

#4
May I suggest:
First draw a line with your 7.0 macro, knowing in advance (or afterward) what the setlinestyle parameters are. Then double click on it and bring up the info box. It'll show the line type, line width, and line scale (not the same thing as drawing scale). I'll bet they match.
those functions are in the macro help file and I copied them here--

Sys(4)  - Current line type [0-12]
[0 = solid, 1 = dashed, 2 = hidden, 3 = center, 4 = phantom, 5 = dotted, 6 = dashdot,
7 = border, 8 = divide, 9 = special-1, 10 = special-2, 11 = speciall-3, 12 = special-4]
Numbers above 12 can be used but will refer to custom line types which may vary from user to user or even drawing to drawing.

Sys(5) - Current line type scale [0<=x<=10e6]
Sys(6) - Current line width [0 <=x<=10e6]

Or, I'll also bet that the <linestyle parameter is similar to what you're doing:

>Line
{
  <Color 0,0,0
  <Layer 1
  <LineStyle 0,10.0000,0.0000
  <PointXYZ 10,10,10
  <PointXYZ 10,15,10
  <PointXYZ 15,10,10
  <PointXYZ 10,10,10
  }


Have fun.


Mark.


myles

Thank you for the excellent responses, I will be testing those out and will probably be back with questions after that.  Thanks!

myles

Ok, this is going to sound like a dumb question, but I have not done any work with anything CAD at any point.  I'm just trying to rewrite this guy's macros for him that he's used like the last 10 years or so.  The gentleman that originally wrote them passed away and his wife threw out all the documentation, so it's been a real challenge.

Anyway, I have a .dw2 drawing that I want to use essentially as a template for every drawing and I want to draw inside of it.  When I open it from the open menu the sizing and everything is perfect, but when I when I merge it into the document using a macro it is really tiny.  I don't even know what to look for (scale? units of measurement?) to attempt to correct that.  Any suggestions?

Thanks in advance.

Lar

#7
Since you don't know CAD I will put what I think is your solution up front and explain it afterwards. The language will probably confuse you.

Possible Solution:
Merge with the 'select after merge' option then scale by 12. Here's one way to write it:

>Merge
{
<Type 1    '0 = not selected after merge, 1 = selected after merge
<Filename "path\filename.ext"   'put in actual path and file name
<PointXYZ  [x, y, z]     'put in the actual xyz values or variables
}

>SelectScaleOrtho
{
<ZoomFactor 12
}


Explanation:
I know that this happens when you merge a unitless drawing into an 'unit-ed' drawing, or vice versa (feet based units should not be affected). For example, if you merge a 10 'unitless' square (which would have been intended to be 10 feet) into an inch based drawing the square will measure 10 inches. If you merge a 10 inch square from an inch based drawing into a unitless drawing the square will be 10 units (10 feet).

If you are merging into an existing drawing the quickest remedy is to scale the merge by the factor difference (in the case of unitless to inches, scale up by 12). If into a new drawing make the drawing unitless and change the units afterwards (activate 'Rescale to new units').

'Unit-ed' drawings were introduced in v15, I think, so all the older drawings would be affected if your new drawing is based on any other unit that unitless or feet.

To change units go to Options menu> Units of Measurement or click the leftmost box in the Status Bar then click 'Change Units...' from the menu.

Lar

myles

Thank you, thank you, thank you.  That's exactly what I was looking for.  I may get this thing updated after all. The saga continues though... only 2500 lines to go!  :D

Lar

myles, I was only able to help after you explained excatly what you situation was. If you do this in the future your conversions would go a lot quicker and I would guess that before long you would be able to offer help to others.

Lar