
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello everyone,
I tried to write a program (with autocad VBA) that import a group of entities (by DXF file) and do rectangular array by user values.
at this moment i have program that get the entities but i did not success to make a block from the entities that i import In order to perform the rectangular array command.
if can some one help me the write the code that can select all the entities i have on the screen and make block from them and after make the rectangular array.
I think i have the selection part too but when i tried the add that entities to the block it didn't success.
Any help will be appreciated
this is the code that i have for this moment
******************************************************************************************************************************
Dim objSS3 As AcadSelectionSet
Set objSS3 = ThisDrawing.SelectionSets.Add("objSS3")
objSS3.Select acSelectionSetAll
If (Not (objSS3 Is Nothing)) Then
objSS3.Clear
Else
Err.Clear
Set objSS3 = ThisDrawing.SelectionSets.Add("objSS3")
End If
' Define the block
Dim blockObj As AcadBlock
Dim insertionPnt(0 To 2) As Double
insertionPnt(0) = (Val(TextBox1.Text) / 2)
insertionPnt(1) = (Val(TextBox2.Text) / 2)
insertionPnt(2) = 0
' Add the block to the blocks collection
Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "Pattren")
MsgBox blockObj.Name & " has been added." & vbCr
Set blockObj = ThisDrawing.Blocks.Add(InsertionPoint, "sset3")
******************************************************************************************************************************
this is the error and what i got in the model space
Solved! Go to Solution.