Author Topic: Problem Application to create LineType  (Read 998 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Problem Application to create LineType
« on: February 10, 2017, 02:27:59 PM »
Hi, how are you

I have a problem I hope they can help me

http://www.theswamp.org/index.php?topic=47058.msg520876#msg520876

When the RONJONP program  has been downloaded to create line types, the problem is that creating it does not maintain a symmetric shape



*1-TUBERIA SONIDO,SONIDO PISO
A,0.143,-0.143,0.143,-0.143,0.143,-0.143,0.143,-0.041,["SON",0-DEU-LINEA,S=0.07,R=0.0,X=-0.0,Y=-0.035],-0.249

I would like to know how I can do to change some values and opt for something symmetric. Thank you



*1-DEU-LT SONIDO-P,SONIDO PISO
A,0.103,-0.08,0.103,-0.15,["SON",0-DEU-LINEA,S=0.07,R=0.0,X=-0.11,Y=-0.035],-0.15,0.103,-0.08
« Last Edit: February 10, 2017, 03:36:08 PM by amc.dicsac »
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Problem Application to create LineType
« Reply #1 on: February 10, 2017, 03:32:41 PM »
Each one of the positive numbers in the code represents a dash.
Negative numbers represent a gap.
The portion inside of, and including the square brackets, is the "SON" text.

So you just need to adjust these values to your liking.

Note that you can also change the leaving "A" to a "S" and this will cause the linetype to behave differently when the object is made longer or shorter.


Example:



amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: Problem Application to create LineType
« Reply #2 on: February 10, 2017, 03:46:00 PM »
Ronjonp uses this function to create the outline of the text that will go in the line
Code - Auto/Visual Lisp: [Select]
  1.   (defun rjp-txtwdth (text height style / d e i pts)
  2.     ;; Check if style has a width other than 1 otherwise gap is incorrect
  3.     (if (and (setq e (tblobjname "style" style)) (setq i (cdr (assoc 41 (entget e)))))
  4.       (setq i (/ 1. i))
  5.       (setq i 1.)
  6.     )
  7.     ;;Returns textstring width, gap from insertion point to start of text, and height
  8.     (if (setq pts (textbox (list (cons 1 text) (cons 7 style) (cons 40 height))))
  9.       (progn (setq d (* i (distance (car pts) (list (caadr pts) (cadar pts)))))
  10.              (list d (caar pts) (- (cadadr pts) (abs (cadar pts))))
  11.       )
  12.     )
  13.   )

And then store it as follows

Code - Auto/Visual Lisp: [Select]
  1. (setq strw (rjp-txtwdth textstring (atof textheight) txtstyle))

At the beginning of the bracket he puts this code
Code - Auto/Visual Lisp: [Select]
  1. (_rtos (abs (- textgap (cadr strw))))

And at the end put the following code
Code - Auto/Visual Lisp: [Select]
  1. (_rtos (+ textgap (car strw) (cadr strw)))

Eh to suppose that there could be the problem.
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>