Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Coordinate Value Extraction

psw1125
Advocate

Coordinate Value Extraction

psw1125
Advocate
Advocate

Hello?
My name is SW Park.
I have a question about extracting coordinates in AutoCAD.
[ figure 1 ] is a simplified picture of the roll-to-roll machine.
Is there a way in AutoCAD to extract equations and a range of X values ​​like [ figure 3 ]?
And is there a way to extract the Y-value coordinates at regular intervals (10) along the X-axis like [ figure 4 ]?

When the number of rolls is small, it can be obtained by hand, but it is difficult because the number of rolls is large.
Opening a DWG file with Windows Notepad will result in unknown code that is difficult to interpret.
When I draw lines and circles in AutoCAD, I think I will use the code for equations and ranges, is there any way to check this?

 

figure 1.PNG

figure 2.PNG

figure 3.PNG

figure 4.PNG

open notepad.PNG

0 Me gusta
Responder
319 Vistas
3 Respuestas
Respuestas (3)

DumR0
Advocate
Advocate

Hi 

to answer to your Q: 1) yes you can extract x value(will be sown in the link below)

                                     2) yes you can extract formulas, as text(the same procedure like in the link below , only you need to uncheck all, an check only the text, > next> content, an you will have the equations, you will have only to edit in notepad, or excel)see image below

Dumitrurobu4BPMD_0-1659332698700.png

 

3) the Y value extract with increment 10, I do not know how, but you cat extract in excel file then make a filter.

This link might help with command DATAEXTRACTION

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/screencast/Main/Details/71d5be51-8...

TheCADnoob
Mentor
Mentor

If I understand your question and data extraction isn't what you are looking for, There are ways to get that information, but you will have to build (or adapt) things to get it done. 

 

If you take your roll line and move the beginning to the origin then use a block that calls out xy coordinates you can use the path array to insert your blocks at a set distance on your line. (you will have to explode the array and REGEN after). (block i used found here)

 

TheCADnoob_0-1659373624561.png

 

Then for the slope you can use a block similar to this to get your slopes. (this block doesn't give you the value you need but demonstrates that it can likely be done) (you can probably take the cot of the angle to get your slope)

 

TheCADnoob_1-1659373870917.png

 

I would spend the time to develop the tools you need so they can meet all the challenges of more complicated roller systems. Check out blocks and dynamic blocks and fields in blocks. 

 

 

CADnoob

EESignature

0 Me gusta

leeminardi
Mentor
Mentor

Here's a vlisp program that writes the equation of a line at its midpoint.  If the line is within approximately 0.001° of being vertical the note "VERTICAL LINE" is added.

leeminardi_0-1659403893664.png

 

(defun c:eqn (/ ed e1 e2 dx m b sgnm sgnb msg midpt)
; determines the equation for a line in the format y = mx + b
; and writes it at the line's midpoint
; L. MINARDI  8/1/2022
  (setq	ed (entget (car (entsel "\nSelect line.")))
	e1 (cdr (assoc 10 ed))
	e2 (cdr (assoc 11 ed))
  )
  (setq dx (- (car e2) (car e1)))
  (setq ang (angle e1 e2))
  (If (> ang pi)
    (setq ang (- ang pi))
  )
 ; check if line is almost vetical 
  (if (equal ang (/ pi 2.) 0.0001)
    (setq m nil)
    (setq m (/
	      (- (cadr e2) (cadr e1))
	      dx
	    )
    )
  )
  (if m
    (progn
      (setq b (- (cadr e1) (* m (car e1))))
      (if (> m 0.0)
	(setq sgnm "+ ")
	(setq sgnm "- ")
      )
      (if (> b 0.0)
	(setq sgnb "+ ")
	(setq sgnb "- ")
      )

      (setq
	msg (strcat "y = " (rtos m 2 3) "x " sgnb (rtos (abs b) 2 3))
      )
    )
    (setq msg " VERTCAL LINE")
  )
  (setq midpt (mapcar '/ (mapcar '+ e1 e2) '(2. 2. 2.)))
  (command "_text" midpt "" "" msg)

  (princ)
)
lee.minardi