Jump to content

Lisp to get same affect of right click of the mouse


Recommended Posts

Posted

Good afternoon all! i am happy to make part of this amazing forum lot of good learnings here. 

 

my question is regards to lisp code to be used on plant 3d so i am not sure if i am posting in a right place.

 

i need to write a lisp line that can do the same as i was clicking on right button of the mouse and chose what to do next, in my case  would be "add to selection all connected parts." i am attaching a image to illustrating what i am trying to do.

 

thank you all!

Add to selection.jpg

Posted

If you can work out the command then easy, Try logfileon this will make a log file as you run CAD logfileoff turns it off. Have a look at the file.

 

The log file location is set in OPTIONS

image.png.2c4daaf5229d8473beca02c084b0aff7.png

 

I use CIV3D which is 3 programs CIV3D MAP and Acad, so rather than switch workspaces I have menus and toolbars with the correct command from each workspace so saves changing workspaces.

Posted

Thanks a lot for your answer Bigal,

I think i wasn't clear enough in my question. i am looking to write a lisp where i can pick a pipe in plant 3d and the lisp will select all connected parts, or all entire line number.

like i use to do with right click of the mouse.

 

Thanks a lot!

Add to selection.jpg

Posted

YES there is a command behind that menu option, not sure where in the CUI the mouse options are which would show the command. Plant will be different.

 

This is the mouse option for is viewport locked so the command line version is the macro without the ^c^c

image.thumb.png.ec0f218fe7fdfd529b98ed75a49927d4.png

Posted (edited)
On 11/10/2021 at 9:53 PM, f.fhelix said:

i need to write a lisp line that can do the same as i was clicking on right button of the mouse and chose what to do next, in my case  would be "add to selection all connected parts." i am attaching a image to illustrating what i am trying to do.

 

Its possible, however LISP is limited for manipulating the mouse - moving and simulating clicks.

So a .NET library must be included to get such additional functionality, meaning compiling and NET-loading some .dll(s) must be involved along with the .lsp code.

I've posted some sample C# library code here (with LISP examples).

Say you could simulate right mouse click, then move the cursor to a fixed distance and then simulate left mouse click (all of this with LISP).

The only annoying thing would be to case-check where the cursor is located relatively to your screen

because the pop-up can appear either on the right or to the left side of the cursor's position.

 

 

Edited by Grrr

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...