Jump to content

Recommended Posts

Posted

Hello,

 

My name is ede and i need our help.

is possible through the coordinated build a drawing in autocad?

 

eg

x | y

0-0

40-0

40-30

0-30

0-0

 

these coordinates are a rectangle 40 by 30 mm.

Looking for some software, or even some command in autocad through which he coordinates draw the part.

 

Any help is welcome.

thank you

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • cad_ede

    11

  • MSasu

    9

  • BIGAL

    2

  • ReMark

    1

Top Posters In This Topic

Posted

This may be done using the script feature of AutoCAD - check the SCRIPT command. To draw a 40x30 rectangle with its bottom-left corner in origin:

_RECTANGLE 0.0,0.0 40.0,30.0 
;end of script

Posted

hello,

where you run this command?

even within autocad?

 

thanks

Posted

but I write rectangle space and give the word rectangle disappears

 

is supposed to?

Posted

Yes, you may paste my example into a text file, save it with SCR extension and after call the aforementioned command in AutoCAD and point to that file.

Posted

ok, since I created the file with scr extension, but now how and what I call the file through the autocad?

Posted

In AutoCAD editor write SCRIPT on command prompt and press . You will be presented with a standard file browse dialog (if the dialog take place on prompter, the set the FILEDIA system variable to 1); navigate to the folder where you saved the SCR file, select it and press OK. The code inside will be executed.

Posted

resulted :) thanks

But imagine that I have just a list of values ​​and need to be drawn, line by line:

 

eg

x | y

0-0

40-0

40-30

0-30

0-0

 

Begins at x = 0 and y = 0 and goes up to x = 40 y = 0 .. and so on.

 

How should I build the script?

There are tutorials and documents for construction of script?

 

thank you

Posted

Do you have that list of data (coordinates and sizes) in electronic format? If the answer is yes, then you may use Excel (or other worksheet tool for that mater) to build the script; it will allow you to easily clone the key-words and data formatting.

Posted

what I have is a list of coordinates of x and y values​​. MAs do not know if these coordinates correspondendem the rectangles or squares or circles.

 

I need only through this list draw lines that transmit the coordinates.

 

eg

x = 0 and Y = 0

x = 5 and y = 5

 

will draw a line from zero to the point x = 5 and y = 5.

 

Do not quite understand this question excel ...

 

thank you

Posted

Excel is a spreadsheet program by Microsoft. You've heard of it haven't you?

Posted

I've heard and I have, but I do not see how I will use it here ....

Posted

Another example

 

Line 0,0 0,30 40,30 40,0 c

 

Just copy this line to your Autocad command line (copy and paste)

 

2 squares

Line 0,0 0,30 40,30 40,0 c

Line 40,30 40,60 80,60 80,30 c

Just copy and paste the two lines

 

Using excel you can make lots of lines simply saving the result to a text file called a script .SCR then like above SCRIPT myscript.scr rectangs appear

Posted

now understand the connection excel.

The objective is through a list of coordinates, x and y, draw lines in autocad.

This list is provided by me already cnc machine.

 

Thanks for the trouble

Posted

Toe reason to resort to Excel is that has built in tools that will save you time by don't having to type or copy/paste strings when building the script; also will allow you to insert very easy spaces (which act as ).

In below example you will need to type only the parts in red; the green one were to be copied/cloned.

[color=red]_CIRCLE[/color] 1.0,1.0 [color=red]_R[/color] 5.0
[color=darkgreen]_CIRCLE[/color] 2.0,2.0 [color=darkgreen]_R[/color] 5.0
[color=darkgreen]_CIRCLE[/color] 3.0,3.0 [color=darkgreen]_R[/color] 5.0
[color=darkgreen]_CIRCLE[/color] 4.0,4.0 [color=darkgreen]_R[/color] 5.0
[color=darkgreen]_CIRCLE[/color] 5.0,5.0 [color=darkgreen]_R[/color] 5.0
;end of script

Posted

I'm trying this code.

 

Line 79.3754 71.3746 c

, end of script

 

he writes the line but then the message

"Point or option keyword required

Specify next point or "

 

How do I not see this message?

 

The objective is to design two rows idependentes one another.

eg:

 

Line 79.3754 71.3746 c

Line 79.3634 71.3626 c

, end of script

 

But it does not work because that message appears at the end of the first line.

 

How should I search to learn more about the design of lines, circles and rectangles via script in autocad?

 

thank you

Posted

First, your points weren't valid since require at least two coordinates while you provided just one.

Line 79.3754[color=red],coordY1st[/color] 71.3746[color=red],coordY2nd[/color]

 

Second, you are using the Close option of LINE command and this isn't allowed in your case since there you drawn only one segment (two points):

[color=red]_Line 1.0,2.0 1.0,3.0 _C           <-- WRONG[/color]
[color=darkgreen]_Line 1.0,2.0 1.0,3.0              <-- CORRECT[/color]
[color=darkgreen]_Line 1.0,2.0 1.0,3.0 2.0,5.0 _C   <-- CORRECT[/color]

 

Third, should use ";" for comments instead of ",":

;end of script

Posted
How should I search to learn more about the design of lines, circles and rectangles via script in autocad?

The easiest solution is to call the commands and note down the answers you provide to their prompters. Press to see the entire dialog. If is about a command with dialog box, then use its command prompt version (i.e. -HATCH).

Posted

I understand :)

 

the syntax is this:

 

Syntax

 

_Line startx,starty endx,endy

space

_Line startx,starty endx,end

space

startx,starty endx,end pointendx,pointendy _C

;end of script

 

The letter "C" for end the draw, correct?

 

eg:

_Line 1.0,2.0 1.0,3.0

 

_Line 1.0,3.0 2.0,3.0

 

_Line 5.0,3.0 7.0,3.0 7.0,3.0 _C

;end of script

 

thanks

Posted
The letter "C" for end the draw, correct?

For LINE command the "C" stand for Close and is indeed a solution to end command's cycle by joining the first point with the last one; the option is valid only if there are at least two segments drawn - that it, a contour to be closed.

For other commands it may have a totally different meaning - for example Color for CHPROP command.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...