Hi,
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
With objEntity
If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
If VBA.Left(VBA.UCase(objEntity.Name), 2) = "*U" Then
MyBlockName = VBA.UCase(objEntity.EffectiveName)
Else
MyBlockName = VBA.UCase(objEntity.Name)
End If
...
End If
End With
Next
Since the problem is not on all computers I expect this problem is related to some setting in AutoCAD.
Any advice is appreciated.
Regards,
Wilbert.
Add to this,
objAutoCad.ActiveSpace = acModelSpace
What are the differences between two PC s operating system and acad versions.
Hi,
objAutoCad.ActiveSpace = acModelSpace gives me Run-tiem error 438 Object doesn't support this propery or method.
I added:
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.
Kind regards,
Wilbert.
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.
Best Regards...
Can't find what you're looking for? Ask the community or share your knowledge.