• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

osnap filter command in transparent mode in vba6

  • Thread starter Thread starter tiziano69
  • Start date Start date

tiziano69

Guest
good morning, I am creating an application that allows to have some autocad commands collected in a form that remains always active in the foreground, for commands (copy, line etc.) there are no problems, as I can do instead to switch to autocad transparently, during a design or modification command, an osnap filter. type I am drawing a line and at a certain point I want to select from the form the end_point filter.

I train the project I started

Thank you.
 

Attachments

bhè is sufficient to type the fine example snap (_end), med (_mid) etc etc so passed as string to the command line.

I have not seen the project, but with a vba sendcommand solve, now translate it into vb and should work.
 
I have already tried (see below) the problem is that obviously osnap filters should be used transparently, example within the already active command, from vb I must be able to select a filter transparently and so on. as it is, it does not happen, if they select the button, the command is finished.

private sub command3_click()
dim utilobj as object
dim objacad as object

set objacad = getobject(, "autocad.application")
set utilobj = objacad.activedocument.utility
'form1.hide
objacad.visible = true

autocad.acadapplication.activedocument.sendcommand "_endp" & vbcr
'form1.show
form1.visible = true
 
....like I'm drawing a line and at some point I want to select from the form the end_point filter.

I train the project I started

Thank you.
when selecting from the form the button to set the osnap mode uses the function for setting the system variables 'setvariable' .
in this case the variable is osmode.
try something like that adapted to your project:
dim sysvardata as integer
sysvarname = "osmode"
sysvardata = 1
thisdrawing.setvariable sysvarname, sysvardata
osmode to 1 means _endpoint, 2 = _midpoint and so on (see help from autocad)
 
ok better than using "sendcommand", the problem is that I am developing in vba6 so that the program always remains open and in the foreground, so or replaced in this way

private sub command6_click()
dim sysvardata as integer
dim sysvarname as string

sysvarname = "osmode"
sysvardata = 1
autocad.activedocument.setvariable sysvarname, sysvardata
“Thisdrawing.setvariable sysvarname, sibling dataend

the problem remains the same, when I click on the button to activate the filter, in autocad nothing happens and after a few seconds there seems to be a time-out problem between the two applications.
 
According to me the problem is related to the fact that you are in an active command, the call of a setvar probably does not pass, for that I said to pass a command in the command (choose the word game) as if it were a script, it is a less elegant way surely but if in autocad during a command to change the snaps you have to pass from the command line 'os or dx mouse button etc.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top