CLARIFICATION: Use of ^DPrompt: to select entities

Some macro commands start with a selection of entities followed by some data on what to do with them. For example:SCLCPY selectEntities;rScaleFactor[Prior];xyOrigin[Prior] If I can put the following data into variables can I use a ^D prompt to select *all* the entities I need?SCLCPY ^DSelect the entities to copy: vScaleFactor;xyOrigin

Comments

  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    I don't think this is possible. The regular selection method doesn't seem to be macro-safe. It will work with a simpler select method, such as 1 each pick, but obviously, that doesn't give you what you are asking for. Depending on the command, you may be able to somewhat emulate it by using loops and checking error codes, but it would still be rather limited compared to the full selection system.
  • DaltonSpenceDaltonSpence Mapmaker
    edited May 2020
    Actually in this case it might. Using SELBY1 I could scale-copy one entity at a time in a loop until the select failed (right click). Is there a way to build a multiple selection in advance so I can use SELBYP to run the command? (I want to use this for a macro drawing tool.)
  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    Currently no. I am thinging about making an XP that would help somewhat in this situation, but it is still in the "thing about it stage", which means that it is still somewhere between several hours and several years off.
  • Could this coding create a multiple selection that could be used?DESELECT SELBY1 :StartSel GE p ^DSelect an Entity: ONTEST IFZ ison EndOfSel STORE vEntity pon SELECT vEntity GOTO StartSel :EndOfSel SELBYP Note the ONTEST macro is used to stop the loop when the click is not on an entity's edge.
  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    That's an interesting approach.

    You'll need to reset the p variable for each loop iteration though, GE won't update p unless you click on an actual entity, just leaving it at the previous value, making the ontest retest the previous point (which passed the test then, so should again), creating an infinite loop.
  • DaltonSpenceDaltonSpence Mapmaker
    edited May 2020
    I checked ONTEST’s use in the macro file and there is always an IFERR between it and the GE. Here is my corrected code. DESELECT SELBY1 :StartSel GE p ^DSelect an Entity: IFERR EndOfSel ONTEST IFZ ison EndOfSel STORE vEntity pon SELECT vEntity GOTO StartSel :EndOfSel SELBYP Would this work? Do I even need the ONTEST?
  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    I think you should be able to skip the ONTEST here, the error flag should be raised if GE didn't get an entity.
  • DaltonSpenceDaltonSpence Mapmaker
    edited May 2020
    Okay, Here is my more compact code. DESELECT SELBY1 :StartSel GE p ^DSelect an Entity: IFERR EndOfSel STORE vEntity p SELECT vEntity GOTO StartSel :EndOfSel SELBYP The description of the STORE command is “Stores a reference to an entity in a variable, so it can later be selected by Select Entity.” Is this a different data type than that stored by the GE command?
  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    GE actually just stores a point, while STORE stores the entity tag. You can easily inspect these things by using LISTVARS to see the different variables stored
Sign In or Register to comment.