jerry00769 Posted October 1, 2023 Posted October 1, 2023 Hello everybody, I would like to ask you for a help. I am programming some Ribbon menu structure for electrical blocks and lines incl. multilines, multitexts. At the moment I am solving the following problem with the INSERT block VBA statement (only VBA programming, no knowledge with others). There si some code for insterting block (standard): Sub Run_Set_BunkyInteraktivne() If ThisDrawing.SummaryInfo.Keywords <> "EPS" Then MsgBox "Toto není šablona EPS, tlačítko z menu nabídky nelze použít!", vbExclamation Exit Sub End If On Error Resume Next Dim strName As String strName = EPS_PATH & "Blocks\" & Block_Name & ".dwg" Dim varInsertionPoint As Variant Dim dblX As Double Dim dblY As Double Dim dblZ As Double Dim dblRotation As Double Dim objBlockRef As AcadBlockReference varInsertionPoint = ThisDrawing.Utility.GetPoint(, "Vyber umístění") dblX = 1 * ThisDrawing.SummaryInfo.Comments / 1000 'měřítko z informace o výkresu dblY = 1 * ThisDrawing.SummaryInfo.Comments / 1000 'měřítko z informace o výkresu dblZ = 1 * ThisDrawing.SummaryInfo.Comments / 1000 'měřítko z informace o výkresu dblRotation = ThisDrawing.Utility.GetAngle(varInsertionPoint, "Vyber úhel") 'zadat manuálně úhel / není interaktivní Set objBlockRef = ThisDrawing.ModelSpace.InsertBlock(varInsertionPoint, strName, dblX, dblY, dblZ, dblRotation) End Sub This code works fine, but it is not interactive for rotating an existing block (dwg file) on the screen (see figure 1 and see figure 2 interactive from the insert block manually dialog). Are there any VBA or LSP code sequences or other alternative for instert block dialog with parameters to change automatically? Thanks so much for your feedback in advance. BR, Jaroslav Quote
BIGAL Posted October 1, 2023 Posted October 1, 2023 Using a menu to insert a block choose block, choose point then can DRAG the angle ^c^cINSERT ca3ch-1 DRAG \1;;DRAG From a program prospective a couple of ways insert the block then invoke rotation of the last object, yes 2 steps. But the user wont see it. Another is pick insertion point then ask for a second point in lisp (getpoint pt1 "\nSelect angle ") this draws a dummy line from the insertion point as you search the screen for angle, you then get angle pt1-pt2. But you do not see block. Quote
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.