martinle Posted May 28, 2014 Posted May 28, 2014 Hello, I have chosen a selection set with ssget and stored in a variable "AWS". How should programiert a selection set that you want to do the following. If the layer A is present in the selection set AWS, then search all the dimensions in the selection set AWS. When dimensions in AWS are present, change the dimensions in layer B. If no dimensions are present, then exit the Lisp. Please for help. Martin Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 You may either parse the items in selection set (see SSNAME function), check their properties with ENTGET/ASSOC and adjust them using ENTMOD or just select them using apropriate filters: (if (setq ssetLayerA (ssget "_X" '((0 . "DIMENSION") (8 . "LayerA")))) (command "_CHPROP" ssetLayerA "" "_LA" "LayerB" "") ) Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hello Mirca Thanks for your help. But it seems to not work. It does not change. One more info: The dimensions are on different layers. Please Help Thank you Martin Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 My Lisp: (defun c:layändern ( / AWS ssetLayerA) (setq AWS(ssget)) (if (setq ssetLayerA (ssget "_X" '((0 . "DIMENSION") (8 . "A")))) (command "_CHPROP" ssetLayerA "" "_LA" "B" "") ) ) Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 First, this statement isn't needed. [s](setq AWS(ssget))[/s] Did you got any error message? Is layer "B" available when you run the code? Is layer "A" un-locked? Try to add the statement below as last line in your command definition. (print (sslength ssetLayerA)) Also, what kind of dimensions were those? What do you get when pick one of them by code below? (print (cdr (assoc 0 (entget (car (entsel)))))) And, not last, please edit your previous post and add required code tags. Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hallo Mircea When you run code: (defun c:layändern ( / AWS ssetLayerA)(if (setq ssetLayerA (ssget "_X" '((0 . "DIMENSION") (8 . "A")))) (command "_CHPROP" ssetLayerA "" "_LA" "B" ""))(print (sslength ssetLayerA))) Befehl: LAYÄNDERN ; Fehler: Fehlerhafter Argumenttyp: lselsetp nil When you run code: Befehl: (print (cdr (assoc 0 (entget (car (entsel)))))) Objekt wählen: "DIMENSION" "DIMENSION" Info: The layers are present and not disabled Please Help. Regards, Martin Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 So, seems that were no dimensions in your "A" layer - that it, the selection set is nil. Please run the code below on one of those items: (prompt (strcat "\nEntity is a " (cdr (assoc 0 (setq assocTemp (entget (car (entsel)))))) " stored in layer \"" (cdr (assoc 8 assocTemp)) "\".")) Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hello No, the dimension is not on layer A. The dimension is on any layer. The layer A is a polyline. If the layer A is found in the selection set is to be sought after dimensions in the selection set and these dimensions on Layer B be moved. regards, Martin Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 So, you want to create a selection set and if it contains at least one entity, no matter its type, stored in layer "A", want to move any dimension from said selection to layer "B"? Out of curiosity, which can be the purpose of such algorithm? Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hello I would like to add an picture example. How does it work? Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hello what should I do there. It is not a list box! The page on http://www.cadtutor reports: Please enter the URL of your image: Http:// Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 The link I suggeted above point to a detailed tutorial on how to attach an image on your Forum post. Didn't that worked for you, Martin? Quote
martinle Posted May 28, 2014 Author Posted May 28, 2014 Hello, I have the button insert image found. but when I click on it takes the field below: Please enter the URL of your image: Http :/ / what can be wrong? Quote
MSasu Posted May 28, 2014 Posted May 28, 2014 Not sure why are you getting that instead of image load dialog; what browser do you use? It is possible to try a different one? 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.