Jump to content

2013 VBA not working


BIGAL

Recommended Posts

I have a VBA program worked fine in 2011 just found out will not work in 2103 a simple fix is required. In 2011 when asking to pick object you just clicked in the model area and then picked object. I am pretty sure I just need a set active viewport statement prior to pick just not sure of the wording. It must be something in the 2013 VBA 64bit runtime.

 

something here thisdrawing.active.viewport "model"
ThisDrawing.Utility.GetEntity oPoly, snapPt, vbCr & "Select polyline :"

Link to comment
Share on other sites

I loaded the dvb then ran it from command line menu etc as a command it works ok, If I run from VBAMAN it does not work makes debugging a bit harder. 2011 worked fine. My help some one else knowing this

 

(vl-vbaload "c:/acadtemp/tryme.dvb")
(vl-vbarun "tryme")

Link to comment
Share on other sites

A bit more found I could make changes to the code in VBAMAN but could not use the Run module option had to use the command line to run. the next code snippet may help someone else we need to run the routine in model & paper space so a simple fix

 

If ThisDrawing.ActiveSpace = acModelSpace Then
Set Thisspace = ThisDrawing.ModelSpace
Else: Set Thisspace = ThisDrawing.PaperSpace
End If
' now just change the normal add entity commands
Set blkobj = Thisspace.InsertBlock(vertPt, CAR, 1#, 1#, 1#, blkangle)
Set arcobj = Thisspace.AddArc(vertPt, cRad, endang, startang)

Link to comment
Share on other sites

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...