Jump to content

selection set


martinle

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

)

)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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