Try to pass an ssget with filter: (ssget "_P" '((-3 ...))).
Command: MOVE
Select objects: Specify opposite corner: 1 found
Select objects:
Specify base point or [Displacement] <Displacement>:
Specify second point or <use first point as displacement>:
Command: _MOVE
Select objects: p <----------------------------
1 found
Try to pass an ssget with filter: (ssget "_P" '((-3 ...))).
This can not work.
I intend to use the P option using the native commands of the cad (no lisp):Code: [Select]Command: MOVE
Select objects: Specify opposite corner: 1 found
Select objects:
Specify base point or [Displacement] <Displacement>:
Specify second point or <use first point as displacement>:
Command: _MOVE
Select objects: p <----------------------------
1 found
I would that the selection group of the P option is the same as indicated by the user before the reactor and not that of the function (ssget "X" ...) present in the reactor.
I'm confused, you intend to use native cad commands (possibly scripts?) without LISP but you are using reactors and ssget?
Are you basically moving object A from location A to B, starting the command again and moving object A from location B to C?
The best advice I can give you is: Do not use ssget in your callback function. There must be a better (more efficient) way to achieve what you want.
(defun SelWithID (ID typeobj / seleztmp selez ent1 n thexdata)
(setq selez (ssget "X" (list (cons 0 typeobj)(list -3 (list "MYAPP")))))
(setq seleztmp (ssadd))
(if selez
(progn
(setq n 0)
(repeat (sslength selez)
(setq ent1 (ssname selez n)
n (1+ n)
)
(setq thexdata (cdr (car (cdr (assoc -3 (entget ent1 (list "MYAPP")))))))
(foreach el thexdata
(if (= (cdr el) (strcat "ID=" ID))
(ssadd ent1 seleztmp)
)
)
)
)
)
(if (= (sslength seleztmp) 0)
nil
seleztmp
)
)
One way to 'restore' the "_P" selection set is something like this:Code - Auto/Visual Lisp: [Select]
(KGA_Sys_VarStackPush '((grips 0) (highlight 0))) ; Store old and apply new values. (KGA_Sys_VarStackPop) ; Restore old values. )
But I have my doubts if it will work inside a reactor callback. In BricsCAD using (sssetfirst) is problematic in that context, but maybe this does not apply to AutoCAD.
Can you also send me these functions?
I am not including the push/pop functions. You probably have your own anyway.
(
...
(
-3
(
"MYAPP"
(1002 . "{")
...
(1002 . "{")
(1000 . "GROUP_ID")
(1005 . "ABC123")
(1002 . "}")
(1002 . "{")
(1000 . "OBJECTS_IN_GROUP")
(1002 . "{")
(1005 . "...")
(1005 . "...")
(1005 . "...")
(1002 . "}")
(1002 . "}")
...
(1002 . "}")
)
)
)
It seems that you application works with groups of objects that share a common ID. Why don't you store references to all the entities in the group in your Xdata? That would be my approach. For functions that I use to format Xdata see here (https://www.theswamp.org/index.php?topic=48868.5).
As you can see I have used acet-sysvar* functions instead of the previous push/pop functions. These acet-sysvar* functions are built-in functions in BricsCAD.
Is there some way to make it work even in AutoCAD without Express Tools?I have edited post #8.
Is there some way to make it work even in AutoCAD without Express Tools?I have edited post #8.
with your help I solved the problem.I am glad to hear that.
However I have not used functions "KGA_Sys_VarStackPush" and "KGA_Sys_VarStackPop".To avoid highlighting and gripping the 'sssetfirst' selection set. You may not notice any effect on small sets (although in BricsCAD I do detect an extra 'blink') but even then this will have an impact on speed.
Why did you have entered these functions?
To avoid highlighting and gripping the 'sssetfirst' selection set. You may not notice any effect on small sets (although in BricsCAD I do detect an extra 'blink') but even then this will have an impact on speed.
with your help I solved the problem.I am glad to hear that.However I have not used functions "KGA_Sys_VarStackPush" and "KGA_Sys_VarStackPop".To avoid highlighting and gripping the 'sssetfirst' selection set. You may not notice any effect on small sets (although in BricsCAD I do detect an extra 'blink') but even then this will have an impact on speed.
Why did you have entered these functions?
(setvar 'GRIPS 0)
Are you saying this error does not occur when KGA_Sys_VarStackPush/Pop are being used?
If so try using:Code: [Select](setvar 'GRIPS 0)
(setvar 'GRIPS 0)
does not work :cry:
I do not have an AutoCAD license and therefore cannot help you with this issue. But IMO it is another reason to abandon the ssget 'workaround' and use Xdata to store the group.
I do not have an AutoCAD license and therefore cannot help you with this issue. But IMO it is another reason to abandon the ssget 'workaround' and use Xdata to store the group.