I use a routine to read all blocks from model space. It normally reads all blocks but now we have one issue.
A block is not read when it's placed below Y-coordinate -170.
- this is only on certain computers, on other computers it runs fine.
- this is only when the VBA program is started from paper space, if it's started from modelspace it reads all blocks.
Code I use to read all blocks:
Set objAutoCad = ThisDrawing.Application
Set objModelSpace = objAutoCad.ActiveDocument.ModelSpace()
For Each objEntity In objModelSpace
If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
If VBA.Left(VBA.UCase(objEntity.Name), 2) = "*U" Then
MyBlockName = VBA.UCase(objEntity.EffectiveName)
MyBlockName = VBA.UCase(objEntity.Name)
Since the problem is not on all computers I expect this problem is related to some setting in AutoCAD.
Any advice is appreciated.
objAutoCad.ActiveSpace = acModelSpace gives me Run-tiem error 438 Object doesn't support this propery or method.
ThisDrawing.ActiveLayout = ThisDrawing.Layouts("Model")
This solved the problem! THANK YOU!
Still strange to me it was running correct on 1 computer and not on another.
Both computers have Windows 7 enterprise, Service Pack 1.
Both computers have AutoCAD 2012 - 64 bits installed.
I am glad to help. Since microsoft did not give any support to vba autodesk do it. If there is slightly difference between to machines libraries, it is effectable.