Jump to content

Recommended Posts

Posted

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

Posted
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

Posted

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"))

Posted
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

Posted

Hello

 

What is wrong with the following code;

(setq sset (ssget '((0 . "*polyline"))))
(if (= sset "*POLYLINE")
   (progn
       (........

 

Thanks

 

Tharwat

Posted

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

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