ramanusu Posted April 30, 2013 Share Posted April 30, 2013 Hi All, Anyone can help my problem, I have VBA code it's working fine in AutoCAD 2008. but it's not woeking in AutoCAD 2011. after hide the forms, i can't get my cad scr. thanks for your helping. Quote Link to comment Share on other sites More sharing options...
Tyke Posted April 30, 2013 Share Posted April 30, 2013 That sometimes happens when you start your macro from the debug window. Try starting it from AutoCAD. Quote Link to comment Share on other sites More sharing options...
ramanusu Posted April 30, 2013 Author Share Posted April 30, 2013 Thanks for your reply. It's not working. i used get point fountion to get the point from user. after hiding the forms. user can't acess AutoCAD Quote Link to comment Share on other sites More sharing options...
Tyke Posted April 30, 2013 Share Posted April 30, 2013 Try stepping through your code in the debug window to the code before you cant access the graphic screen. Then post the problem area in your code so that we can have a look at it. Quote Link to comment Share on other sites More sharing options...
ramanusu Posted April 30, 2013 Author Share Posted April 30, 2013 (edited) I can't get point from CAD. using below code. see next post. Edited April 30, 2013 by ramanusu code removed Quote Link to comment Share on other sites More sharing options...
SLW210 Posted April 30, 2013 Share Posted April 30, 2013 Please read the CODE POSTING GUIDELINES and edit your post to include Code Tags. Quote Link to comment Share on other sites More sharing options...
ramanusu Posted April 30, 2013 Author Share Posted April 30, 2013 see my code below. Private Sub CommandButton5_Click() On Error GoTo ErrHandler Pump_curve_main.Hide ThisDrawing.Activate Call pick_point TextBox11.text = CStr(Round(scale_pt(0), 0)) TextBox12.text = CStr(Round(scale_pt(1), 0)) ThisDrawing.Activate Pump_curve_main.Show Exit Sub ErrHandler: MsgBox "Please Pick a Point Error: " & _ Err.Description, vbDefaultButton1, "Pump Curve Creator" Pump_curve_main.Show Exit Sub End Sub Sub pick_point() scale_pt = ThisDrawing.Utility.GetPoint(, "Pick a Scale origin point:") End Sub Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 1, 2013 Share Posted May 1, 2013 I tried your code and it works fine, I can pick a point and the rounded coordinates are displayed in two text boxes. What I don't see in your code is the declaration for the variable 'scale_pt'. I declared it as a variant Dim scale_pt As Variant Check your declaration of the variable and note that there are no parentheses { () } in the declaration. Quote Link to comment Share on other sites More sharing options...
ramanusu Posted May 3, 2013 Author Share Posted May 3, 2013 While using that point i try to draw a line it's gave a error "The object invoked has disconnected from clients" Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 4, 2013 Share Posted May 4, 2013 To draw a line you need at least two points. You need to save the point you picked in a variable, then repeat the point picking and save that point in another variable. Then you can use these two points to draw your line. BTW did you manage to get your code to work? Quote Link to comment Share on other sites More sharing options...
ramanusu Posted May 6, 2013 Author Share Posted May 6, 2013 you re right. I get that point and add some value in y axis for 2nd point. i have draw line while form showing time. it's draw in AutoCad 2008 but it's not working in Autcad 2010. i don't know why Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.