Is there a way to apply a selection filter to MStretch?

Is there a way to apply a selection filter to MStretch?

mdolanVQYAA
Enthusiast Enthusiast
327 Views
2 Replies
Message 1 of 3

Is there a way to apply a selection filter to MStretch?

mdolanVQYAA
Enthusiast
Enthusiast

I have a grid of rectangles. I want to use MStretch to stretch one side of a subset of the rectangles, but I only want to select the rectangles and not all the objects (lines, blocks, etc.) in the same location.

 

If I preselect objects and then start the command the preselected objects are unselected.  I have only tried the below.  Are there any other ways of interacting with the MStretch that might work for me?

 

TypedValue[] tvs = new TypedValue[] {
new TypedValue((int)DxfCode.Operator,"<or"),
new TypedValue((int)DxfCode.Operator,"<and"),
new TypedValue((int)DxfCode.LayerName,"WORK_BOUNDARY"),
new TypedValue((int)DxfCode.Start,"LWPOLYLINE"),
new TypedValue((int)DxfCode.Operator,"and>"),
new TypedValue((int)DxfCode.Operator,"or>")};

SelectionFilter sf = new SelectionFilter(tvs);

doc.Editor.WriteMessage("Enter to modify selected workshapes");

PromptSelectionResult acSSPrompt = doc.Editor.GetSelection(sf);
SelectionSet selectionSet = acSSPrompt.Value;
ed.SetImpliedSelection(selectionSet);

doc.SendStringToExecute("MStretch", true, false, true);

 

I have used the same technique/code for other commands such as MOVE.

0 Likes
Accepted solutions (1)
328 Views
2 Replies
Replies (2)
Message 2 of 3

ActivistInvestor
Mentor
Mentor
Accepted solution

See this post

0 Likes
Message 3 of 3

mdolanVQYAA
Enthusiast
Enthusiast

Thanks @ActivistInvestor and @_gile for the work on that post.  It looks promising.  Let me see if I can repurpose it for my needs and I'll circle back and accept the solution or have further questions.

0 Likes