Tharwat Posted July 3, 2010 Posted July 3, 2010 Hello . Any idea of how to change a particular a DXF code in an object... for example; Suppose that I got the DXF codes of an entity with function 'entget' and I wanted to change the color of that entity by user input and rewriting a DXF codes with entmake . Many Thanks. Tharwat Quote
lpseifert Posted July 3, 2010 Posted July 3, 2010 you'll want to use (subst...) and (entmod...) http://www.afralisp.net/autolisp/tutorials/into-the-database.php http://ronleigh.info/autolisp/ales13.htm hint: do a search of this forum for 'entmod' Quote
Tharwat Posted July 3, 2010 Author Posted July 3, 2010 you'll want to use (subst...) and (entmod...)http://www.afralisp.net/autolisp/tutorials/into-the-database.php http://ronleigh.info/autolisp/ales13.htm hint: do a search of this forum for 'entmod' Thank you so much But I have a confusion between LWPOLYLINE and POLYLINE as the following; (setq ent1 (car(entsel"\nSelect Polyline:")) ent2 (entget ent1) poly (cdr(assoc 0 ent2)) ) How to get the Entity name correctly for polylines ???? (if (= (or (LWPOLYLINE)(POLYLINE)) poly);;; <-- [color="Red"]it is not correct[/color] or like this (if (= "LWPOLYLINE,POLYLINE" poly);;; <-- [color="red"]it is not correct[/color] Or like this (if (= "*POLYLINE" poly);;; <-- [color="red"]it is not correct[/color] What is the correct selection for all types of polylines ... ? Best regards. Tharwat Quote
lpseifert Posted July 3, 2010 Posted July 3, 2010 To make a selection set of nothing but polylines (lwpolylines, etc...) (ssget '((0 . "*POLYLINE"))) to make a selection set of just 1 polyline (ssget ":S" '((0 . "*POLYLINE"))) or using your method with (entget...) (if (wcmatch poly "*POLYLINE")) Quote
Tharwat Posted July 3, 2010 Author Posted July 3, 2010 To make a selection set of nothing but polylines (lwpolylines, etc...) (ssget '((0 . "*POLYLINE"))) to make a selection set of just 1 polyline (ssget ":S" '((0 . "*POLYLINE"))) Thanks a lot. But why can not we know the name of the Entity from the function ' entget ' to implement the function ' if ' with it .... ?? many Thanks Tharwat Quote
Tharwat Posted July 3, 2010 Author Posted July 3, 2010 Hello What is wrong with the following code; (setq sset (ssget '((0 . "*polyline")))) (if (= sset "*POLYLINE") (progn (........ Thanks Tharwat Quote
lpseifert Posted July 3, 2010 Posted July 3, 2010 a cursory inspection... No. 1. sset is a selection set, ssget returns the selection set's name, not the entities' type No. 2 what are you using the = function to do? If you want to see if it's a polyline you need to strip the entity type from the dxf codes. No. 3. you can't use a wildcard to compare strings in the = function there's more Quote
Recommended Posts
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.