Jump to content

Recommended Posts

Posted

Hello.

 

How to increase the width of polyline ?

Although I included its codes within the entmakex ?

 

(entmakex (list
         (cons 0 "LWPOLYLINE")
         (cons 100 "AcDbEntity")
         (cons 100 "AcDbPolyline")
         (cons 90 2)
     (cons 40 60)[color=red][b]; <- Start Width is not increasing[/b][/color]
     (cons 41 60)[b][color=red]; <- end Width is not increasing[/color][/b]
         (cons 10 pt1)
         (cons 10 pt2)
         (cons 210 (trans '(0. 0. 1.) 1 0 t))
     ))
  

 

Thank you .

 

Michaels

Posted (edited)

Please take note to the example below.

If you use 40 & 41, You need a start and end width for each point or just set 43 for global width by itself.

Also if you use 40 & 41, You also set the width for 40 & 41 each point call.

If you use 43 by itself, Then it is called before the points.

Also note the order of each DXF call.

 

When you pull the list of the entity you are making, You will know what information it is looking for and how it is arranged.

Refer to you Develpoer Help Section in AutoCAD for information on DXF values. (See image below)

 

(-1 . <Entity name: 7ef59e88>)
(0 . "LWPOLYLINE")
(330 . <Entity name: 7ef59cf8>)
(5 . "89")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbPolyline")
(90 . 2)
(70 . 0)
[color=red][b](43 . 60.0) ;Constant width (optional; default = 0). Not used if variable width (codes 40 and/or 41) is set [/b][/color]
(38 . 0.0)
(39 . 0.0)
[color=red][b](10 -0.315076 5.33922) ;pt1[/b][/color]
[color=red][b](40 . 60.0)  ;start width[/b][/color]
[color=red][b](41 . 60.0)  ;end width[/b][/color]
(42 . 0.0)
[color=red][b](10 80.2275 5.33922) ;pt2[/b][/color]
[color=red][b](40 . 60.0)  ;start width[/b][/color]
[color=red][b](41 . 60.0)  ;end width[/b][/color]
(42 . 0.0)
(210 0.0 0.0 1.0)

Document1.jpg

Edited by The Buzzard
Posted (edited)

throw in (cons 43 60) in there

 

Try something like this

 

(defun c:test (/ pt1 pt_lst pt2)
   (setq pt1  (getpoint "\nPick first point:"))

   (if pt1
     (setq pt_lst (cons pt1 pt_lst))
   )
   (while
     (setq pt2 (getpoint pt1 "\nPick Next point:"))
      (if pt2
 (progn
   (grdraw pt1 pt2 6 1)
   (setq pt_lst (cons pt2 pt_lst)
  pt1 pt2
   )
 )
      )
   )
   (entmakex
     (append (list (cons 0 "LWPOLYLINE")
     (cons 100 "AcDbEntity")
     (cons 100 "AcDbPolyline")
     (cons 90 (length pt_lst))
     (cons 70 0)
     [color=sienna];(cons 40 50)<------- whatttttt?????[/color]
[color=sienna]      ;(cons 41 50)<------- dont even bother pBe[/color]
[color=sienna]      ;(cons 42 50)<------ silly me[/color]
     (cons 43 50)
      )
      (mapcar (function (lambda (x) (cons 10 x))) pt_lst)
     )
   )
 )

 

Credit to Lee Mac for Entmakex

Edited by pBe
Fix Error of my ways
Posted (edited)

Oops :o

Nevermind.. Buzzard beat me to it :)

 

Anyways... if you want a closed polyline change 70 to 1

 

Besides, I never knew about this

 

if you use 40 & 41, You need a start and end width for each point or just set 43 for global width by itself.

Also if you use 40 & 41, You also set the width for 40 & 41 each point call.

If you use 43 by itself, Then it is called before the points.

 

Thanks Buzzard :)

Edited by pBe
Posted
throw in (cons 43 60) in there :)

 

Try something like this

 

(defun c:test (/ pt1 pt_lst pt2)
(setq pt1 (getpoint "\nPick first point:"))

(if pt1
(setq pt_lst (cons pt1 pt_lst))
)
(while
(setq pt2 (getpoint pt1 "\nPick Next point:"))
(if pt2
(progn
(grdraw pt1 pt2 6 1)
(setq pt_lst (cons pt2 pt_lst)
pt1 pt2
)
)
)
)
(entmakex
(append (list (cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 100 "AcDbPolyline")
(cons 90 (length pt_lst))
(cons 70 0)
(cons 41 50)
(cons 42 50)
(cons 43 50)
)
(mapcar (function (lambda (x) (cons 10 x))) pt_lst)
)
)
)

 

Credit to Lee Mac for Entmakex

 

pbe, You might want to fix

(cons 42 50)

as it is bulge factor. Also no need for 40 & 41 if you plan to set global width with 43. You would use 40 & 41 if you were doing LWPOLYLINES in shapes such as arrow heads & things of the sort.

Posted
pbe, You might want to fix
(cons 42 50)

as it is bulge factor. Also no need for 40 & 41 if you plan to set global width with 43. You would use 40 & 41 if you were doing LWPOLYLINES in shapes such as arrow heads & things of the sort.

 

Got it,

 

Thanks :)

Posted (edited)
Got it,

 

Thanks :)

 

No problem,

 

I use this little code below that Lee made some fixes for me quite a while ago to get the list of dxf information of an entity. When making a DXF code, I try to keep the information in the same assembled order. When you randomly place DXF information together and you are not careful of how it is arranged can give you some problems. There are some entities that are not so delicate that you might get away with misarranging things, But then when you do real complex entites such as hatch patterns it can make all the world of a difference. So it is good practice to keep DXF information in the order you extract from it. Also parts of the code that are listed as optional that you may not make any changes to are not needed in the code. Just thought I would mention this.

 

(defun C:pdxf (/ pick)
 (if (setq pick (car (entsel "\nSelect Object: ")))
   (progn (textscr)
   (foreach x (entget pick)
     (print x))))
 (princ))

 

In Michaels case with the code he provided, This is all he really needs to do.

 

 (entmakex
   (list
     (cons 0 "LWPOLYLINE")
     (cons 100 "AcDbEntity")
     (cons 100 "AcDbPolyline")
     (cons 90 2)
     [color=red](cons 43 60); <- Global Width[/color]
     (cons 10 pt1)
     (cons 10 pt2)
     (cons 210 (trans '(0. 0. 1.) 1 0 t))
   )
 )

Edited by The Buzzard
Posted

Here is a situation of an LWPOLYLINE with different width factors.

Notice there is no DXF code 43 for global width.

(-1 . <Entity name: 7ef59e90>)
(0 . "LWPOLYLINE")
(330 . <Entity name: 7ef59cf8>)
(5 . "8A")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbPolyline")
(90 . 2)
(70 . 0)
(38 . 0.0)
(39 . 0.0)
[color=red](10 0.0385237 5.27296); pt1[/color]
[color=red](40 . 60.0)[/color]
[color=red](41 . 0.0)[/color]
(42 . 0.0)
[color=red](10 49.9039 5.27296); pt2[/color]
[color=red](40 . 0.0)[/color]
[color=red](41 . 0.0)[/color]
(42 . 0.0)
(210 0.0 0.0 1.0)

Document1.jpg

Posted
I use this little code below that Lee made some fixes for me quite a while ago to get the list of dxf information of an entity.

 

Thanks Buzzard, I'm glad you can put it to good use :)

 

Here is a much better one I have written:

 

http://lee-mac.com/entitylist.html

Posted
Thanks Buzzard, I'm glad you can put it to good use :)

 

Here is a much better one I have written:

 

http://lee-mac.com/entitylist.html

 

That certainly is a much better code Lee, It returns much more complete information.

 

Thanks

Posted
That certainly is a much better code Lee, It returns much more complete information.

 

Thanks

 

You're very welcome - happy to be of assistance :)

Posted

Thank you all Guys. :)

 

It's been very helpful.

 

Appreciated.

Posted
Thank you all Guys. :)

 

It's been very helpful.

 

Appreciated.

 

Your welcome Michaels, Try to make use of the Developer Help Section. There is a world of information there and it is not hard to understand. It will make you more self sufficient.

Good Luck

Posted
Your welcome Michaels, Try to make use of the Developer Help Section. There is a world of information there and it is not hard to understand. It will make you more self sufficient.

Good Luck

 

I will do, and special thanks to you for your hard work for me .

 

Greatly appreciated.

 

Michaels

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...