Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the object (or handle) of new objects created using WBlockCloneObjects

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
michael.robertson
287 Views, 4 Replies

Get the object (or handle) of new objects created using WBlockCloneObjects

I created new entities in a file using WBlockCloneObjects from a different file.

I have a collection of objectids from the source file.

Once I pass this collection to the WBlockCloneOjbects is there a way to get to the objectids (or handles) of the objects cloned into the new file? I need to change the layer on each new object.

Thanks in advance,
Mike

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
4 REPLIES 4
Message 2 of 5

Message 3 of 5

If you are wanting to change them all to the same layer (whatever that layer might be) you can trap them all in a selection set. To do this, set the last entity as a marker, proceed with the wblock, cycle through the new entities to create your selection set, and then do what you want with them.

 

(setq Marker (entlast))

;wblock, copy, or whatever here

(setq tempSS (ssadd))

(while (setq Marker (entnext Marker))

(setq tempSS (ssadd Marker tempSS))

)

(command ".chprop" tempSS "" "layer" "whateverlayer" "")

 

 

Message 4 of 5

Sorry for posting in the wrong forum.

 

I was thinking I would have to do something like you suggest.

 

I'll give that a try.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 5 of 5

Found I could use the "GetAllObjects" method of the current TransactionManager to retrieve these objects.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost