CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedAutolisp File

 Post Reply Post Reply
Author
1616syd View Drop Down
Newbie
Newbie


Joined: 17.Apr.2013
Location: United Kingdom
Using: AutoCAD Architecture 2014
Status: Offline
Points: 16
Direct Link To This Post Topic: Autolisp File
    Posted: 27.Jan.2014 at 22:41
Anyone got a lisp file which will enable the properties of a LWPOLYLINE to be matched to a LINE
and thus converting it into a LWPOLYLINE, in much the same way as the MATCH PROPERTIES
does with other objects.Clap
SydUK
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 686
Direct Link To This Post Posted: 28.Jan.2014 at 15:09
Try this, in nearly simplest terms:
 
(defun C:MPPL
; = Match Properties of Polyline to Line [including converting Line to Polyline]
  (/ pl lin)
  (setq pea (getvar 'peditaccept))
  (setvar 'peditaccept 1)
  (setq
    pl (car (entsel "\nSelect Polyline to match Line to: "))
    lin (car (entsel "\nSelect Line to convert to Polyline and match selected one: "))
  ); setq
  (command
    "_.pedit" lin ""
    "_.matchprop" pl lin ""
  ); command
  (setvar 'peditaccept pea)
); defun
 
It ought to be enhanced with valid-object-type selection controls, maybe command-echo suppression, error handling, and all the other usual bells and whistles, but as a start it works for me, in limited testing.
Back to Top
1616syd View Drop Down
Newbie
Newbie


Joined: 17.Apr.2013
Location: United Kingdom
Using: AutoCAD Architecture 2014
Status: Offline
Points: 16
Direct Link To This Post Posted: 28.Jan.2014 at 15:18
Thank you for that Kent, it works OK, other than it has to be run a second
time to create the global width of the new polyline to match original if greater than 0.
Kind regards
Syd
SydUK
Back to Top
1616syd View Drop Down
Newbie
Newbie


Joined: 17.Apr.2013
Location: United Kingdom
Using: AutoCAD Architecture 2014
Status: Offline
Points: 16
Direct Link To This Post Posted: 28.Jan.2014 at 15:58
Hello Kent
I've managed to juggle your code with the addition of entlast in
the matchprop call instead of lin, which holds only the original data
fo the selected line, and not the new polyline.
 
(defun C:MPPL (/ pl lin)
  (setq pea (getvar 'peditaccept))
  (setvar 'peditaccept 1)
  (setq
    pl (car (entsel "\nSelect Polyline to match Line to: "))
    lin (car (entsel "\nSelect Line to convert to Polyline and match selected one: "))
  ); setq
  (command "_.pedit" lin "" "_.matchprop" pl (entlast) "")
  (setvar 'peditaccept pea)
  (princ)
); defun
Kind Regards
Syd
SydUK
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 686
Direct Link To This Post Posted: 28.Jan.2014 at 17:02
Ah, yes, of course....  I at first had it doing Matchprop before Pedit, and I reversed that specifically in case of non-zero width, but didn't think about the entity-name change, and obviously didn't test the reversed-order version in that situation.
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,070 seconds.