- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
This is my first question in this forum so please bear with me.
I'm a beginner in Autolisp and donot have a good handle on all the concepts yet.
I'm trying to create a lisp routine for my company where I need to run a function on the block before the refedit editor opens. I can currently get it to work for the main block (See attached PartialWorkingMethod.lsp ). However it does not open the nested block to edit in place like the refedit command does.
I'm trying two methods to get it to work on nested blocks. Some ideas and/or code snippets found in various question other people have asked.
Method 1 (See attached Method_1.lsp )
Here I'm using nentsel to get the depth of the nested block in the main block and setting the main block as selected object by sending the main block entity name to ssadd and then using sssetfirst and then calling _.-refedit. Since I am setting the main block as selected it won't select any nested block for edit looping to the correct nested block with the command "N" . I tried to send the nested block name to ssadd but that returns nill. Anything I can use here to set the nested block as the selected so that the refedit can loop to the correct nested block with the command "N" ? Or a way to send it directly to the refedit command?
Method 2 (See attached Method_2.lsp )
Here I'm calling the refedit command first and then pausing for input. After the selection I'm trying to get the selection set from the active document and iterating for the first object. I'm missing something here because the object selected after calling refedit is not added to the selection set, so it refers to an older selection set I think.
Any insight on what I'm doing wrong or what I can use to get it working?
A completely new way of doing it will be fine as well. Any help is greatly appreciated. Thanks in advance.
Edit 1: The default refedit selects the nested block when the refedit window is open
But my routine selects the main block.
As the users will have blocks with a lot of nested block they will have to iterate their nested block selection manually before they enter the nested block to edit. I need it to select the nested block that is being clocked on when this routine is run.
And (command "_.-refedit" "N") just opens the main block for editing not the nested block.
The final goal is to check the presence of a particular attribute in the selected main block and continue with the refedit if it in NOT present. If it is present then quit with a message.
I have figured out how to extract the attributes and values list. But not the refedit part.
Solved! Go to Solution.