exchange pcbDoc.TransactionStart() to pcbDoc.TransactionStart(epcbDRCModeNone)
Hopefully it helps.
thanks for the quick response.
I tried your suggestion, but it doesnt work.
I also disabled / set loose conditions to the DRC, but this also brings up the error.
This is the example in the training in AATK/help/labspowerpoints.
Is the component connected to fixed/locked traces?
If so try after unlocking/unfixing them.
Can also enable move circuit (Place -> Move circuit) but this behaves different (f.e. unfixed trace connected to locked via will move the via in 'move circuit' mode while in normal mode it will change trace)
'Cannot Lock the server' is because the script stopped between TransactionStart & TransactionEnd so Expedition thinks transaction is still ongoing (which locks server).
well, currently there are no traces. I started a new simple design (just a Voltage Devider), then i placed the unplaced parts
manually, all components are unlocked, and then i tried to use my code snippet from above. So there are like mentioned no traces so far.
I have added a few traces now, and these traces I can move, with a MOVE / MoveRelative Command.
The Components, still give me an 'DRC-Violation' error, Even when i try your suggestion.
Another thing. in the meanwhile (since yesterday) I also found the original Mentor Expeditipon script called Component_Move.
I excecuted that VBS script under the Mentor Script Environment, and it gives me the same error like my VB.Net code.
But Matthias, thanks for the Info regarding the server and its lock state.
The only thing I can think of is that the epcbDRCModeNone is not known in Vb.net so transaction will work in DRC mode.
Mayby try using a fixed number instead?
- epcbDRCModeDRC (1)
- epcbDRCModeNone (0)
- epcbDRCModeNoneWithBatchQuery (8)
- epcbDRCModeResolve (2)
- epcbDRCModifierGloss (-2147483648)
- epcbDRCModifierShowHazardGraphics (1073741824)
Attached is the code in vbs which works for me.
MoveComp.vbs.zip 801 bytes
- epcbDRCModeDRC (1)
This works for me in my VB.net code:
sorry for being so late with my reply, but you made it. Your Script is working, even in my .Net Environment.
I played a little bit around with your script and my initial code and look for the difference. Currently I dont know
where the mistake is, but I will have a look in the next weeks.
So, really really thanks.
1 of 1 people found this helpful
I use a similar method:
Turn off the DRC, then use the transactionstart(0) and transactionend(true). Then turn DRC back on if you want.
Dim comp As MGCPCB.Component
Dim gui As MGCPCB.Gui
Dim ec As MGCPCB.EditorControl
gui = pcbapp.Gui
gui.SuppressTrivialDialogs = True
ec = pcbdoc.EditorControl
ec.InteractiveDRC = false
If pcbdoc.TransactionStart(0) = True Then
comp = get_comp_to_move
comp.Orientation = orientation
ec.InteractiveDRC = True
gui.SuppressTrivialDialogs = False
There should be a command like:
Move this component where I tell you to no matter what it steps on. Yes, just do it. I know. It causes an error. Do it anyway.
The above method is that, for the most part.